mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
c710b7f8f2
Skip failure when running tests when we're explicitly testing failure cases. Be more specific about failure conditions via NSError param
30 lines
1.1 KiB
Objective-C
30 lines
1.1 KiB
Objective-C
//
|
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
|
//
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
typedef NS_ENUM(NSUInteger, CDSSigningCertificateErrorCode) {
|
|
// AssertionError's indicate either developer or some serious system error that should never happen.
|
|
//
|
|
// Do not use this for an "expected" error, e.g. something that could be induced by user input which
|
|
// we specifically need to handle gracefull.
|
|
CDSSigningCertificateError_AssertionError = 1,
|
|
|
|
CDSSigningCertificateError_InvalidPEMSupplied,
|
|
CDSSigningCertificateError_CouldNotExtractLeafCertificate,
|
|
CDSSigningCertificateError_InvalidDistinguishedName,
|
|
CDSSigningCertificateError_UntrustedCertificate
|
|
};
|
|
|
|
NSError *CDSSigningCertificateErrorMake(CDSSigningCertificateErrorCode code, NSString *localizedDescription);
|
|
|
|
@interface CDSSigningCertificate : NSObject
|
|
|
|
+ (nullable CDSSigningCertificate *)parseCertificateFromPem:(NSString *)certificatePem error:(NSError **)error;
|
|
|
|
- (BOOL)verifySignatureOfBody:(NSString *)body signature:(NSData *)theirSignature;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|