-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARTCipherParams
and ARTCrypto
doc comments
#1439
Changes from all commits
385ff3d
d693aa1
fd86ccd
b87ee16
3e0875b
3cce613
4511851
0deb0a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -28,13 +28,20 @@ NS_ASSUME_NONNULL_BEGIN | |||||||||
@end | ||||||||||
|
||||||||||
/** | ||||||||||
ARTCipherParams contains configuration options for a channel cipher, including algorithm, mode, key length and key. | ||||||||||
Ably client libraries currently support AES with CBC, PKCS#7 with a default key length of 256 bits. All implementations also support AES128. | ||||||||||
The ARTCipherParams object contains properties to configure encryption for a channel. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe
|
||||||||||
*/ | ||||||||||
@interface ARTCipherParams : NSObject <ARTCipherParamsCompatible> | ||||||||||
|
||||||||||
/// The algorithm to use for encryption. Only `AES` is supported. | ||||||||||
@property (readonly, strong, nonatomic) NSString *algorithm; | ||||||||||
|
||||||||||
/// The private key used to encrypt and decrypt payloads. | ||||||||||
@property (readonly, strong, nonatomic) NSData *key; | ||||||||||
|
||||||||||
/// The length of the key in bits; for example 128 or 256. | ||||||||||
@property (readonly, nonatomic) NSUInteger keyLength; | ||||||||||
|
||||||||||
/// The cipher mode. Only `CBC` is supported. | ||||||||||
@property (readonly, getter=getMode) NSString *mode; | ||||||||||
|
||||||||||
- (instancetype)init UNAVAILABLE_ATTRIBUTE; | ||||||||||
|
@@ -44,11 +51,30 @@ NS_ASSUME_NONNULL_BEGIN | |||||||||
|
||||||||||
@end | ||||||||||
|
||||||||||
/** | ||||||||||
The ARTCrypto object ensures that message payloads are encrypted, can never be decrypted by Ably, and can only be decrypted by other clients that share the same secret symmetric key. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
@tbedford @m-hulbert as I mentioned elsewhere in this PR, I think this sort of formatting should be part of the canonical docs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree with the change and this is also part of the canonical table already. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure whether I agree with this description entirely. I think that the description of how encryption works in Ably is a good one, but it's not the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is something like the following more accurate?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about
|
||||||||||
*/ | ||||||||||
@interface ARTCrypto : NSObject | ||||||||||
|
||||||||||
+ (ARTCipherParams *)getDefaultParams:(NSDictionary *)values; | ||||||||||
/** | ||||||||||
Retrieves, or optionally sets, the `ARTCipherParams` for the channel. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think I agree with this description. My understanding is that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this more accurate?
|
||||||||||
@param params Overrides the default parameters. A suitable key must be provided as a minimum. | ||||||||||
@return An `ARTCipherParams` object, using the default values for any field not supplied. | ||||||||||
*/ | ||||||||||
+ (ARTCipherParams *)getDefaultParams:(NSDictionary *)params; | ||||||||||
|
||||||||||
/** | ||||||||||
Generates a random key to be used in the encryption of the channel. | ||||||||||
@param keyLength The length of the key, in bits, to be generated. | ||||||||||
@return The key as a binary data. | ||||||||||
*/ | ||||||||||
+ (NSData *)generateRandomKey:(NSUInteger)keyLength; | ||||||||||
|
||||||||||
/** | ||||||||||
Same as `+generateRandomKey:`, but with the default key length of the default algorithm: for AES this is 256 bits. | ||||||||||
@return The key as a binary data. | ||||||||||
*/ | ||||||||||
+ (NSData *)generateRandomKey; | ||||||||||
+ (NSData *)generateRandomKey:(NSUInteger)length; | ||||||||||
|
||||||||||
@end | ||||||||||
|
||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tbedford @m-hulbert I’d suggest that this sort of formatting should be in the canonical documentation, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with the formatting. It is already styled as code in the canonical docs though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will link to the page that user is already on. Is this what was expected? @lawrence-forooghian