Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
enzevalos_iphone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
enzevalos
enzevalos_iphone
Commits
18016fbb
Commit
18016fbb
authored
5 years ago
by
maik65
Browse files
Options
Downloads
Patches
Plain Diff
issue
#137
: calling function findMailforSecretKey in function storeMultipleKeys.
parent
4a715c64
No related branches found
No related tags found
2 merge requests
!58
Onboarding screens swift ui merge dev
,
!55
WIP: Resolve "UI for gamifcation & stats"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
enzevalos_iphone/SwiftPGP.swift
+10
-6
10 additions, 6 deletions
enzevalos_iphone/SwiftPGP.swift
with
10 additions
and
6 deletions
enzevalos_iphone/SwiftPGP.swift
+
10
−
6
View file @
18016fbb
...
...
@@ -316,16 +316,20 @@ class SwiftPGP: Encryption {
return
readKeys
(
data
:
data
,
importDate
:
importDate
)
}
private
func
storeMultipleKeys
(
keys
:
[
Key
],
pw
:
String
?,
secret
:
Bool
)
->
[
String
]{
private
func
storeMultipleKeys
(
keys
:
[
Key
],
pw
:
String
?,
secret
:
Bool
)
->
[
String
]
{
var
ids
=
[
String
]()
let
keyring
=
Keyring
()
// merge secret and public keys
keyring
.
import
(
keys
:
keys
)
let
newKeys
=
keyring
.
keys
for
k
in
newKeys
{
if
k
.
isSecret
&&
secret
||
!
k
.
isSecret
&&
!
secret
{
ids
.
append
(
storeKey
(
key
:
k
))
if
let
password
=
pw
{
for
k
in
newKeys
{
if
k
.
isSecret
&&
secret
||
!
k
.
isSecret
&&
!
secret
{
let
id
=
storeKey
(
key
:
k
)
ids
.
append
(
id
)
if
k
.
isSecret
&&
secret
{
findMailForSecretKey
(
keyID
:
id
)
}
if
let
password
=
pw
{
pwKeyChain
[
k
.
keyID
.
longIdentifier
]
=
password
}
}
...
...
@@ -335,7 +339,7 @@ class SwiftPGP: Encryption {
func
store
(
tempKeys
:
[
TempKey
])
->
[
String
]
{
var
ids
:
[
String
]
=
[]
tempKeys
.
forEach
{
tempKeys
.
forEach
{
ids
.
append
(
contentsOf
:
storeMultipleKeys
(
keys
:
[
$0
.
key
!
],
pw
:
$0
.
password
,
secret
:
$0
.
isSecret
))
}
return
ids
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment