SCM iOS API
|
Class describes a private key object. Inherits from Key. More...
Instance Methods | |
(Boolean) | - isPartialHash |
(void) | - hashAndSign:hashAlg:completionHandler: |
(void) | - sign:hashAlg:completionHandler: |
(void) | - decrypt:completionHandler: |
![]() | |
(NSString *) | - getKeyType |
(NSString *) | - getAlgorithmName |
(NSUInteger) | - getkeyLength |
(void) | - getModulus: |
(void) | - getPublicExponent: |
![]() | |
(NSString *) | - getType |
(NSString *) | - getCkLabel |
(NSString *) | - getCkId |
(Token *) | - getParent |
(NSUInteger) | - getPinNumber |
Class describes a private key object. Inherits from Key.
Note that the constructor is not intended to be called by user code. Such objects are constructed internally by the API.
- (void) decrypt: | (NSData *) | data | |
completionHandler: | (void(^)(NSData *dataDecrypted, NSError *)) | completionHandler | |
Decrypts the provided data using a private key. The operation will use PKCS#1 padding.
data | NSData containing the ciphertext data to decrypt. |
completionHandler | the completion handler to call when the decryption is complete. The completion handler is executed on the main queue and takes the following parameters :
|
- (void) hashAndSign: | (NSData*) | data | |
hashAlg: | (NSString *) | hashAlg | |
completionHandler: | (void(^)(NSData *signature, NSError *error)) | completionHandler | |
Hashes the provided data and signs the hash using a private key. The operation will use PKCS#1 padding.
The hashAlg parameter indicates the hash algorithm to use and can take the following values :
"sha1"
or "sha256"
: Available for all keys (SHA-1 may be forbidden with qualified signature keys depending on the card profil; "sha384"
or "sha512"
: Not available for qualified keys. data | data to hash, provided as NSData. |
hashAlg | algorithm of the hash. |
completionHandler | the completion handler to call when the signature is complete. The completion handler is executed on the main queue and takes the following parameters :
|
- (Boolean) isPartialHash |
Returns YES if the key must use partial hashing (qualified signature key). Available only for private keys.
- (void) sign: | (NSData *) | hash | |
hashAlg: | (NSString *) | hashAlg | |
completionHandler: | (void(^)(NSData *signature, NSError *)) | completionHandler | |
Signs the provided hash using a private key. The operation will use PKCS#1 padding.
The algorithm of the hash needs to be indicates if the OID needs to be added within the signature block. The hashAlg parameter can take the following values :
"nil"
: The hash data will be signed as provided. Not available for qualified signature keys. "sha1"
, "sha256"
, "sha384"
or "sha512"
: The corresponding OIS will be prepended. Not available for qualified signature. "sha1-partial"
or "sha256-partial"
: The hash must be provided as a partial hash block (containing intermediate hash values). The PrivateKey#isPartialHash method can be used to check whether the key is a qualified signature key that requires partial hashing.
hash | the hash value. |
hashAlg | algorithm of the hash. |
completionHandler | the completion handler to call when the signature is complete. The completion handler is executed on the main queue and takes the following parameters :
|