WSCKey Class Reference
| Inherits from | WSCKeychainItem : NSObject |
| Declared in | WSCKey.h WSCKey.m |
Overview
The WSCKey class is a subclass of WSCKeychainItem representing a key that is stored in a keychain.
On the other hand, if the key represented by WSCKey is not stored in a keychain,
passing it to methods of WaxSealCore returns errors.
Tasks
Attributes of a Key
-
keyDataproperty -
keyAlgorithmproperty -
encryptAlgorithmproperty -
keySizeInBitsproperty -
keyClassproperty -
keyUsageproperty -
effectiveDateproperty -
expirationDateproperty
Comparing Keys
Keychain Services Bridge
-
secKeyproperty -
+ keyWithSecKeyRef:
Properties
effectiveDate
The effective date of a key represented by receiver.
@property (retain, readonly) NSDate *effectiveDateReturn Value
nil if a key doesn’t have an effective date.
Declared In
WSCKey.hencryptAlgorithm
The encrypt algorithm of a key represented by receiver.
@property (assign, readonly) WSCKeyAlgorithmType encryptAlgorithmDeclared In
WSCKey.hexpirationDate
The expiration date of a key represented by receiver.
@property (retain, readonly) NSDate *expirationDateReturn Value
nil if a key doesn’t have an expiration date.
Declared In
WSCKey.hkeyAlgorithm
The key algorithm of a key represented by receiver.
@property (assign, readonly) WSCKeyAlgorithmType keyAlgorithmDeclared In
WSCKey.hkeyClass
The type of a key represented by receiver.
@property (assign, readonly) WSCKeyClass keyClassDeclared In
WSCKey.hkeyData
The key data bytes of a key represented by receiver.
@property (retain, readonly) NSData *keyDataDeclared In
WSCKey.hkeySizeInBits
The size in bits of a key represented by receiver.
@property (assign, readonly) NSUInteger keySizeInBitsDeclared In
WSCKey.hkeyUsage
The usage of a key represented by receiver.
@property (assign, readonly) WSCKeyUsage keyUsageDeclared In
WSCKey.hsecKey
The reference of the SecKey opaque object, which wrapped by WSCKey object. (read-only)
@property (unsafe_unretained, readonly) SecKeyRef secKeyDiscussion
If you are familiar with the underlying Certificate, Key, and Trust Services API, you can move freely back and forth between WaxSealCore framework and Certificate, Key, and Trust Services API with this property.
Declared In
WSCKey.hClass Methods
keyWithSecKeyRef:
Creates and returns a WSCKey object using the given reference to the instance of SecKey opaque type.
+ (instancetype)keyWithSecKeyRef:(SecKeyRef)_SecKeyRefParameters
- _SecKeyRef
A reference to the instance of
SecKeyopaque type.
Return Value
A WSCKey object initialized with the given reference to the instance of SecKey opaque type.
Return nil if _SecKeyRef is nil or an error occured.
Discussion
If you are familiar with the underlying Certificate, Key, and Trust Services API, you can move freely back and forth between WaxSealCore framework and Certificate, Key, and Trust Services API with this class method.
Warning: This method is just used for bridge between WaxSealCore framework and Certificate, Key, and Trust Services API.
Instead of invoking this method, you should construct a WSCKey object by invoking:
- publicKey property of
WSCCertificateItem
Declared In
WSCKey.hInstance Methods
isEqualToKey:
Returns a BOOL value that indicates whether a given key is equal to receiver.
- (BOOL)isEqualToKey:(WSCKey *)_AnotherKeyParameters
- _AnotherKey
The key with which to compare the receiver.
Return Value
YES if _AnotherKey is equivalent to receiver (if they have the same data bytes);
otherwise NO.
One more thing
When you know both objects are keychains, this method is a faster way to check equality than method isEqual:.
Declared In
WSCKey.h