mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-01-31 00:00:06 +08:00
Return type of the key
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "OpenVPNKeyType.h"
|
||||
|
||||
@interface OpenVPNPrivateKey : NSObject
|
||||
|
||||
+ (nullable OpenVPNPrivateKey *)keyWithPEM:(nonnull NSData *)pemData
|
||||
@@ -21,6 +23,7 @@
|
||||
- (nonnull instancetype) __unavailable init;
|
||||
|
||||
@property (nonatomic, readonly) NSInteger size;
|
||||
@property (nonatomic, readonly) OpenVPNKeyType type;
|
||||
|
||||
- (nullable NSData *)pemData:(out NSError * __nullable * __nullable)error;
|
||||
- (nullable NSData *)derData:(out NSError * __nullable * __nullable)error;
|
||||
|
||||
@@ -33,6 +33,10 @@
|
||||
return mbedtls_pk_get_bitlen(self.ctx);
|
||||
}
|
||||
|
||||
- (OpenVPNKeyType)type {
|
||||
return (OpenVPNKeyType)mbedtls_pk_get_type(self.ctx);
|
||||
}
|
||||
|
||||
+ (nullable OpenVPNPrivateKey *)keyWithPEM:(NSData *)pemData password:(NSString *)password error:(out NSError **)error {
|
||||
OpenVPNPrivateKey *key = [OpenVPNPrivateKey new];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user