mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-25 04:47:55 +00:00
66 lines
1.8 KiB
Objective-C
66 lines
1.8 KiB
Objective-C
//
|
|
// SUSignatures.h
|
|
// Sparkle
|
|
//
|
|
// Created by Kornel on 15/09/2018.
|
|
// Copyright © 2018 Sparkle Project. All rights reserved.
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
typedef NS_ENUM(uint8_t, SUSigningInputStatus) {
|
|
/// An input was not provided at all.
|
|
SUSigningInputStatusAbsent = 0,
|
|
|
|
/// An input was provided, but did not have the correct format.
|
|
SUSigningInputStatusInvalid,
|
|
|
|
/// An input was provided and can be used for verifying signing information.
|
|
SUSigningInputStatusPresent,
|
|
SUSigningInputStatusLastValidCase = SUSigningInputStatusPresent
|
|
};
|
|
|
|
#ifndef BUILDING_SPARKLE_TESTS
|
|
SPU_OBJC_DIRECT_MEMBERS
|
|
#endif
|
|
@interface SUSignatures : NSObject <NSSecureCoding>
|
|
#if SPARKLE_BUILD_LEGACY_DSA_SUPPORT
|
|
@property (nonatomic, readonly, nullable) NSData *dsaSignature;
|
|
@property (nonatomic, readonly) SUSigningInputStatus dsaSignatureStatus;
|
|
#endif
|
|
|
|
@property (nonatomic, readonly, nullable) const unsigned char *ed25519Signature;
|
|
@property (nonatomic, readonly) SUSigningInputStatus ed25519SignatureStatus;
|
|
|
|
- (instancetype)initWithEd:(NSString * _Nullable)ed
|
|
#if SPARKLE_BUILD_LEGACY_DSA_SUPPORT
|
|
dsa:(NSString * _Nullable)dsa
|
|
#endif
|
|
;
|
|
@end
|
|
|
|
|
|
#ifndef BUILDING_SPARKLE_TESTS
|
|
SPU_OBJC_DIRECT_MEMBERS
|
|
#endif
|
|
@interface SUPublicKeys : NSObject
|
|
|
|
@property (nonatomic, readonly, nullable) NSString *dsaPubKey;
|
|
@property (nonatomic, readonly) SUSigningInputStatus dsaPubKeyStatus;
|
|
|
|
@property (nonatomic, readonly, nullable) const unsigned char *ed25519PubKey;
|
|
@property (nonatomic, readonly) SUSigningInputStatus ed25519PubKeyStatus;
|
|
|
|
/// Returns YES if either key is present (though they may be invalid).
|
|
@property (nonatomic, readonly) BOOL hasAnyKeys;
|
|
|
|
- (instancetype)initWithEd:(NSString * _Nullable)ed
|
|
dsa:(NSString * _Nullable)dsa
|
|
;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|