SecKeyGeneratePairAsync(_:_:_:)
Generates a public/private key pair.
Declaration
func SecKeyGeneratePairAsync(_ parameters: CFDictionary, _ deliveryQueue: dispatch_queue_t, _ result: @escaping SecKeyGeneratePairBlock)Parameters
- parameters:
A key generation parameter dictionary. At minimum, this must contain Ksecattrkeytype and Ksecattrkeysizeinbits. In addition, this function assumes default values for the following keys:
Ksecattrlabel defaults to
NULL.Ksecattrispermanent if this key is present and has a value of Kcfbooleantrue, the key or key pair will be added to the default keychain.
Ksecattrapplicationtag defaults to
NULL.Ksecattreffectivekeysize defaults to
NULL, which means the effective key size is the same as the key size (Ksecattrkeysizeinbits).Ksecattrcanencrypt defaults to Kcfbooleanfalse for private keys, Kcfbooleantrue for public keys.
Ksecattrcandecrypt defaults to Kcfbooleantrue for private keys, Kcfbooleanfalse for public keys.
Ksecattrcanderive defaults to Kcfbooleantrue.
Ksecattrcansign defaults to Kcfbooleantrue for private keys, Kcfbooleanfalse for public keys.
Ksecattrcanverify defaults to Kcfbooleanfalse for private keys, Kcfbooleantrue for public keys.
Ksecattrcanwrap defaults to Kcfbooleanfalse for private keys, Kcfbooleantrue for public keys.
Ksecattrcanunwrap defaults to Kcfbooleantrue for private keys, Kcfbooleanfalse for public keys.
These default values can be overridden by adding a value for the associated key in the parameter dictionary.
- deliveryQueue:
The dispatch queue on which the result block should be scheduled.
- result:
A block of type Seckeygeneratepairblock that gets called with the result upon completion.