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
Robert Long
Olm
Commits
0a6a5a5c
Commit
0a6a5a5c
authored
Apr 07, 2022
by
François Ganard
Committed by
Hubert Chathi
Apr 08, 2022
Browse files
Add public pickle/unpickle methods to java bindings
parent
b5dfa28f
Changes
3
Hide whitespace changes
Inline
Side-by-side
android/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java
View file @
0a6a5a5c
...
...
@@ -369,4 +369,29 @@ public class OlmInboundGroupSession extends CommonSerializeUtils implements Seri
* @return the deserialized session
**/
private
native
long
deserializeJni
(
byte
[]
aSerializedData
,
byte
[]
aKey
);
/**
* Return a pickled inbound group session as a bytes buffer.<br>
* The session 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 inbound group session as bytes buffer
*/
public
byte
[]
pickle
(
byte
[]
aKey
,
StringBuffer
aErrorMsg
)
{
return
serialize
(
aKey
,
aErrorMsg
);
}
/**
* Loads an inbound group session 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
);
}
}
android/olm-sdk/src/main/java/org/matrix/olm/OlmOutboundGroupSession.java
View file @
0a6a5a5c
...
...
@@ -293,4 +293,28 @@ public class OlmOutboundGroupSession extends CommonSerializeUtils implements Ser
**/
private
native
long
deserializeJni
(
byte
[]
aSerializedData
,
byte
[]
aKey
);
/**
* Return a pickled outbound group session as a bytes buffer.<br>
* The session 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 outbound group session as bytes buffer
*/
public
byte
[]
pickle
(
byte
[]
aKey
,
StringBuffer
aErrorMsg
)
{
return
serialize
(
aKey
,
aErrorMsg
);
}
/**
* Loads an outbound group session 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
);
}
}
android/olm-sdk/src/main/java/org/matrix/olm/OlmSession.java
View file @
0a6a5a5c
...
...
@@ -465,5 +465,30 @@ public class OlmSession extends CommonSerializeUtils implements Serializable {
* @return the deserialized session
**/
private
native
long
deserializeJni
(
byte
[]
aSerializedData
,
byte
[]
aKey
);
/**
* Return a pickled session as a bytes buffer.<br>
* The session 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 session as bytes buffer
*/
public
byte
[]
pickle
(
byte
[]
aKey
,
StringBuffer
aErrorMsg
)
{
return
serialize
(
aKey
,
aErrorMsg
);
}
/**
* Loads a session 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
Supports
Markdown
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