Class ECPublicKey
-
- All Implemented Interfaces:
-
kotlin.Comparable,org.signal.libsignal.internal.NativeHandleGuard.Owner,org.signal.libsignal.protocol.SerializablePublicKey
public final class ECPublicKey extends NativeHandleGuard.SimpleOwner implements Comparable<ECPublicKey>, SerializablePublicKey
-
-
Constructor Summary
Constructors Constructor Description ECPublicKey(ByteArray serialized, Integer offset)ECPublicKey(ByteArray serialized)ECPublicKey(ByteArray serialized, Integer offset, Integer length)ECPublicKey(Long nativeHandle)
-
Method Summary
Modifier and Type Method Description final ByteArraygetPublicKeyBytes()final IntegergetType()final BooleanverifySignature(ByteArray message, ByteArray signature)final ByteArrayseal(ByteArray message, ByteArray info, ByteArray associatedData)Seals a message so only the holder of the private key can decrypt it. final ByteArrayseal(ByteArray message, String info, ByteArray associatedData)A convenience overload of seal(ByteArray,ByteArray,ByteArray), using the UTF-8 bytes of info.final ByteArrayserialize()Booleanequals(Object other)IntegerhashCode()IntegercompareTo(ECPublicKey other)final static ECPublicKeyfromPublicKeyBytes(ByteArray key)-
Methods inherited from class org.signal.libsignal.internal.NativeHandleGuard.SimpleOwner
unsafeNativeHandleWithoutGuard -
Methods inherited from class org.signal.libsignal.internal.NativeHandleGuard.Owner
guard, guardedMap, guardedMapChecked, guardedRun, guardedRunChecked -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getPublicKeyBytes
final ByteArray getPublicKeyBytes()
-
verifySignature
final Boolean verifySignature(ByteArray message, ByteArray signature)
-
seal
final ByteArray seal(ByteArray message, ByteArray info, ByteArray associatedData)
Seals a message so only the holder of the private key can decrypt it.
Uses HPKE (RFC 9180). The output will include a type byte indicating the chosen algorithms and ciphertext layout. The
infoparameter should typically be a static value describing the purpose of the message, whileassociatedDatacan be used to restrict successful decryption beyond holding the private key.
-
seal
final ByteArray seal(ByteArray message, String info, ByteArray associatedData)
A convenience overload of seal(ByteArray,ByteArray,ByteArray), using the UTF-8 bytes of
info.
-
compareTo
Integer compareTo(ECPublicKey other)
-
fromPublicKeyBytes
final static ECPublicKey fromPublicKeyBytes(ByteArray key)
-
-
-
-