Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
matrix-org
Olm
Commits
59076a6b
Commit
59076a6b
authored
Oct 23, 2018
by
manuroe
Browse files
OLMKit: Expose PK private key length
parent
1aafac28
Changes
2
Hide whitespace changes
Inline
Side-by-side
xcode/OLMKit/OLMPkDecryption.h
View file @
59076a6b
...
...
@@ -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
xcode/OLMKit/OLMPkDecryption.m
View file @
59076a6b
...
...
@@ -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. */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment