mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-04-24 00:00:05 +08:00
Return size of the key in bits
This commit is contained in:
@@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
- (nonnull instancetype) __unavailable init;
|
- (nonnull instancetype) __unavailable init;
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) NSInteger size;
|
||||||
|
|
||||||
- (nullable NSData *)pemData:(out NSError * __nullable * __nullable)error;
|
- (nullable NSData *)pemData:(out NSError * __nullable * __nullable)error;
|
||||||
- (nullable NSData *)derData:(out NSError * __nullable * __nullable)error;
|
- (nullable NSData *)derData:(out NSError * __nullable * __nullable)error;
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,10 @@
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSInteger)size {
|
||||||
|
return mbedtls_pk_get_bitlen(self.ctx);
|
||||||
|
}
|
||||||
|
|
||||||
+ (nullable OpenVPNPrivateKey *)keyWithPEM:(NSData *)pemData password:(NSString *)password error:(out NSError **)error {
|
+ (nullable OpenVPNPrivateKey *)keyWithPEM:(NSData *)pemData password:(NSString *)password error:(out NSError **)error {
|
||||||
OpenVPNPrivateKey *key = [OpenVPNPrivateKey new];
|
OpenVPNPrivateKey *key = [OpenVPNPrivateKey new];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user