#import <Foundation/Foundation.h>
#import <ProtocolBuffer/PBCodable.h>
typedef NS_ENUM(int32_t, OTPrivateKey_KeyType) {
OTPrivateKey_KeyType_EC_NIST_CURVES = 1,
};
#ifdef __OBJC__
NS_INLINE NSString *OTPrivateKey_KeyTypeAsString(OTPrivateKey_KeyType value)
{
switch (value)
{
case OTPrivateKey_KeyType_EC_NIST_CURVES: return @"EC_NIST_CURVES";
default: return [NSString stringWithFormat:@"(unknown: %i)", value];
}
}
#endif
#ifdef __OBJC__
NS_INLINE OTPrivateKey_KeyType StringAsOTPrivateKey_KeyType(NSString *value)
{
if ([value isEqualToString:@"EC_NIST_CURVES"]) return OTPrivateKey_KeyType_EC_NIST_CURVES;
return OTPrivateKey_KeyType_EC_NIST_CURVES;
}
#endif
#ifdef __cplusplus
#define OTPRIVATEKEY_FUNCTION extern "C" __attribute__((visibility("hidden")))
#else
#define OTPRIVATEKEY_FUNCTION extern __attribute__((visibility("hidden")))
#endif
__attribute__((visibility("hidden")))
@interface OTPrivateKey : PBCodable <NSCopying>
{
NSData *_keyData;
OTPrivateKey_KeyType _keyType;
}
@property (nonatomic) OTPrivateKey_KeyType keyType;
- (NSString *)keyTypeAsString:(OTPrivateKey_KeyType)value;
- (OTPrivateKey_KeyType)StringAsKeyType:(NSString *)str;
@property (nonatomic, retain) NSData *keyData;
- (void)copyTo:(OTPrivateKey *)other;
- (void)mergeFrom:(OTPrivateKey *)other;
OTPRIVATEKEY_FUNCTION BOOL OTPrivateKeyReadFrom(__unsafe_unretained OTPrivateKey *self, __unsafe_unretained PBDataReader *reader);
@end