Commit 238c512d authored by Hubert Chathi's avatar Hubert Chathi Committed by GitHub

Merge pull request #75 from matrix-org/manuroe/objc_pk_private_key_length

OLMKit: Expose PK private key length
parents 1aafac28 c0d118f4
......@@ -59,6 +59,13 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (NSString *)decryptMessage:(OLMPkMessage*)message error:(NSError* _Nullable *)error;
/**
Private key length.
@return the length in bytes.
*/
+ (NSUInteger)privateKeyLength;
@end
NS_ASSUME_NONNULL_END
......@@ -130,7 +130,7 @@
return privateKey;
}
-(NSString *)decryptMessage:(OLMPkMessage *)message error:(NSError *__autoreleasing _Nullable *)error {
- (NSString *)decryptMessage:(OLMPkMessage *)message error:(NSError *__autoreleasing _Nullable *)error {
NSData *messageData = [message.ciphertext dataUsingEncoding:NSUTF8StringEncoding];
NSData *macData = [message.mac dataUsingEncoding:NSUTF8StringEncoding];
NSData *ephemeralKeyData = [message.ephemeralKey dataUsingEncoding:NSUTF8StringEncoding];
......@@ -189,6 +189,10 @@
return plaintext;
}
+ (NSUInteger)privateKeyLength {
return olm_pk_private_key_length();
}
#pragma mark OLMSerializable
/** Initializes from encrypted serialized data. Will throw error if invalid key or invalid base64. */
......
......@@ -5,7 +5,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0OLMPKEncryption
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
......
PODS:
- OLMKit (2.0.1):
- OLMKit/olmc (= 2.0.1)
- OLMKit/olmcpp (= 2.0.1)
- OLMKit/olmc (2.0.1)
- OLMKit/olmcpp (2.0.1)
- OLMKit (2.3.0):
- OLMKit/olmc (= 2.3.0)
- OLMKit/olmcpp (= 2.3.0)
- OLMKit/olmc (2.3.0)
- OLMKit/olmcpp (2.3.0)
DEPENDENCIES:
- OLMKit (from `../OLMKit.podspec`)
EXTERNAL SOURCES:
OLMKit:
:path: ../OLMKit.podspec
:path: "../OLMKit.podspec"
SPEC CHECKSUMS:
OLMKit: 12a35a69f92c7facdd50b559128d1b4a17857ba7
OLMKit: 6af55a19917c35f86df5198c213979ecdf8ba76e
PODFILE CHECKSUM: 4e261dae61d833ec5585ced2473023b98909fd35
COCOAPODS: 1.1.1
COCOAPODS: 1.6.0.beta.2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment