diff options
author | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2014-09-23 22:20:51 -0700 |
---|---|---|
committer | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2014-09-23 22:21:12 -0700 |
commit | b6da8d0ff12a4d5f4fe271e820249a957e9381e9 (patch) | |
tree | 8f5f50bcd89499eb44e278d030a757d90f81a10c /src/objc/rfc822 | |
parent | 1e02942c98780dbfb69940f525d8c56cf4be477d (diff) |
Provided helpers for OpenPGP encryption and signature
Diffstat (limited to 'src/objc/rfc822')
-rw-r--r-- | src/objc/rfc822/MCOMessageBuilder.h | 15 | ||||
-rw-r--r-- | src/objc/rfc822/MCOMessageBuilder.mm | 10 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/objc/rfc822/MCOMessageBuilder.h b/src/objc/rfc822/MCOMessageBuilder.h index 93e2a387..1663d6f7 100644 --- a/src/objc/rfc822/MCOMessageBuilder.h +++ b/src/objc/rfc822/MCOMessageBuilder.h @@ -61,6 +61,21 @@ /** RFC 822 formatted message for encryption.*/ - (NSData *) dataForEncryption; +/** + Returns an OpenPGP signed message with a given signature. + The signature needs to be computed on the data returned by -dataForEncryption + before calling this method. + You could use http://www.netpgp.com to generate it. + */ +- (NSData *) openPGPSignedMessageDataWithSignatureData:(NSData *)signature; + +/** + Returns an OpenPGP encrypted message with a given encrypted data. + The encrypted data needs to be computed before calling this method. + You could use http://www.netpgp.com to generate it. + */ +- (NSData *) openPGPEncryptedMessageDataWithEncryptedData:(NSData *)encryptedData; + /** HTML rendering of the message to be displayed in a web view. The delegate can be nil.*/ - (NSString *) htmlRenderingWithDelegate:(id <MCOHTMLRendererDelegate>)delegate; diff --git a/src/objc/rfc822/MCOMessageBuilder.mm b/src/objc/rfc822/MCOMessageBuilder.mm index 023697e3..c122ab14 100644 --- a/src/objc/rfc822/MCOMessageBuilder.mm +++ b/src/objc/rfc822/MCOMessageBuilder.mm @@ -100,4 +100,14 @@ MCO_OBJC_SYNTHESIZE_STRING(setBoundaryPrefix, boundaryPrefix) return MCO_TO_OBJC(MCO_NATIVE_INSTANCE->plainTextBodyRendering(stripWhitespace)); } +- (NSData *) openPGPSignedMessageDataWithSignatureData:(NSData *)signature +{ + return MCO_TO_OBJC(MCO_NATIVE_INSTANCE->openPGPSignedMessageDataWithSignatureData(MCO_FROM_OBJC(mailcore::Data, signature))); +} + +- (NSData *) openPGPEncryptedMessageDataWithEncryptedData:(NSData *)encryptedData +{ + return MCO_TO_OBJC(MCO_NATIVE_INSTANCE->openPGPEncryptedMessageDataWithEncryptedData(MCO_FROM_OBJC(mailcore::Data, encryptedData))); +} + @end |