mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-24 04:45:24 +00:00
(feat) add KEY support for certificate handling
This commit is contained in:
@@ -128,6 +128,8 @@ typedef enum
|
||||
- (NSArray *) categories;
|
||||
- (NSString *) photo;
|
||||
- (void) setPhoto: (NSString *) _value;
|
||||
- (NSData *) certificate;
|
||||
- (void) setCertificate: (NSData *) theCertificate;
|
||||
|
||||
|
||||
// - (void) setN: (NGVCardName *) _v;
|
||||
|
||||
@@ -302,6 +302,27 @@
|
||||
[photo setSingleValue: _value forKey: @""];
|
||||
}
|
||||
|
||||
- (NSData *) certificate
|
||||
{
|
||||
CardElement *key;
|
||||
|
||||
key = [self uniqueChildWithTag: @"key"];
|
||||
return [[[key valuesAtIndex: 0 forKey: @""] objectAtIndex: 0] dataByDecodingBase64];
|
||||
}
|
||||
|
||||
- (void) setCertificate: (NSData *) theCertificate
|
||||
{
|
||||
CardElement *key;
|
||||
NSString *value;
|
||||
|
||||
value = [theCertificate stringByEncodingBase64];
|
||||
key = [self uniqueChildWithTag: @"key"];
|
||||
[key setValue: 0 ofAttribute: @"encoding" to: @"base64"];
|
||||
[key setValue: 0 ofAttribute: @"type" to: @"application/pkcs7-signature"];
|
||||
|
||||
[key setSingleValue: value forKey: @""];
|
||||
}
|
||||
|
||||
|
||||
- (void) setOrg: (NSString *) anOrg
|
||||
units: (NSArray *) someUnits
|
||||
|
||||
Reference in New Issue
Block a user