Skip to content
GitLab
Menu
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
d47c2a92
Commit
d47c2a92
authored
Jun 08, 2021
by
Hubert Chathi
Browse files
make new pickle/unpickle function
parent
4803f419
Pipeline
#6074
passed with stages
in 3 minutes and 15 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
android/olm-sdk/src/main/java/org/matrix/olm/OlmAccount.java
View file @
d47c2a92
...
...
@@ -353,7 +353,7 @@ public class OlmAccount extends CommonSerializeUtils implements Serializable {
* @return the account as bytes buffer
*/
@Override
p
ublic
byte
[]
serialize
(
byte
[]
aKey
,
StringBuffer
aErrorMsg
)
{
p
rotected
byte
[]
serialize
(
byte
[]
aKey
,
StringBuffer
aErrorMsg
)
{
byte
[]
pickleRetValue
=
null
;
// sanity check
...
...
@@ -389,7 +389,7 @@ public class OlmAccount extends CommonSerializeUtils implements Serializable {
* @exception Exception the exception
*/
@Override
p
ublic
void
deserialize
(
byte
[]
aSerializedData
,
byte
[]
aKey
)
throws
Exception
{
p
rotected
void
deserialize
(
byte
[]
aSerializedData
,
byte
[]
aKey
)
throws
Exception
{
String
errorMsg
=
null
;
try
{
...
...
@@ -417,4 +417,29 @@ public class OlmAccount extends CommonSerializeUtils implements Serializable {
* @return the deserialized account
**/
private
native
long
deserializeJni
(
byte
[]
aSerializedDataBuffer
,
byte
[]
aKeyBuffer
);
/**
* Return a pickled account as a bytes buffer.<br>
* The account is serialized and encrypted with aKey.
* In case of failure, an error human readable
* description is provide in aErrorMsg.
* @param aKey encryption key
* @param aErrorMsg error message description
* @return the pickled account as bytes buffer
*/
public
byte
[]
pickle
(
byte
[]
aKey
,
StringBuffer
aErrorMsg
)
{
return
serialize
(
aKey
,
aErrorMsg
);
}
/**
* Loads an account from a pickled bytes buffer.<br>
* See {@link #serialize(byte[], StringBuffer)}
* @param aSerializedData bytes buffer
* @param aKey key used to encrypted
* @exception Exception the exception
*/
public
void
unpickle
(
byte
[]
aSerializedData
,
byte
[]
aKey
)
throws
Exception
{
deserialize
(
aSerializedData
,
aKey
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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