Package anbxj
Class Crypto_SealedPair
java.lang.Object
anbxj.Crypto_SealedPair
- All Implemented Interfaces:
Serializable
Represents a sealed pair of objects (key, message) used for encryption.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCrypto_SealedPair(SealedObject sealedKey, SealedObject sealedMessage, String cipherScheme) Constructs a Crypto_SealedPair with the specified sealed key, message, and cipher scheme.Crypto_SealedPair(SealedObject sealedKey, SealedObject sealedMessage, String cipherScheme, Crypto_ByteArray digest) Constructs a Crypto_SealedPair with the specified sealed key, message, cipher scheme, and digest. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic Crypto_SealedPairfromByteArray(byte[] data) Deserializes aCrypto_SealedPairfrom a byte array, delegating toCrypto_SerializationUtils.deserialize(byte[]).Returns the cipher scheme used.Returns the sealed key.Returns the sealed message.inthashCode()byte[]Serializes thisCrypto_SealedPairinto a byte array using standard Java object serialization, delegating toCrypto_SerializationUtils.serialize(Object).toString()
-
Constructor Details
-
Crypto_SealedPair
Constructs a Crypto_SealedPair with the specified sealed key, message, and cipher scheme.- Parameters:
sealedKey- The sealed key.sealedMessage- The sealed message.cipherScheme- The cipher scheme used for encryption.
-
Crypto_SealedPair
public Crypto_SealedPair(SealedObject sealedKey, SealedObject sealedMessage, String cipherScheme, Crypto_ByteArray digest) Constructs a Crypto_SealedPair with the specified sealed key, message, cipher scheme, and digest.- Parameters:
sealedKey- The sealed key.sealedMessage- The sealed message.cipherScheme- The cipher scheme used for encryption.digest- The digest for checking equality of objects (for testing).
-
-
Method Details
-
getCipherScheme
Returns the cipher scheme used.- Returns:
- the cipher scheme as a String.
-
getSealedKey
Returns the sealed key.This method provides the sealed key, which is an instance of
SealedObject.- Returns:
- the sealed key.
-
getSealedMessage
Returns the sealed message.This method provides the sealed message, which is an instance of
SealedObject.- Returns:
- the sealed message.
-
toByteArray
Serializes thisCrypto_SealedPairinto a byte array using standard Java object serialization, delegating toCrypto_SerializationUtils.serialize(Object).This is used by protobuf-based serializers to embed the pair as an opaque
bytesfield.- Returns:
- the serialized bytes
- Throws:
IOException- if an I/O error occurs during serialization
-
fromByteArray
public static Crypto_SealedPair fromByteArray(byte[] data) throws IOException, ClassNotFoundException Deserializes aCrypto_SealedPairfrom a byte array, delegating toCrypto_SerializationUtils.deserialize(byte[]).- Parameters:
data- the bytes produced bytoByteArray()- Returns:
- the reconstructed
Crypto_SealedPair - Throws:
IOException- if an I/O error occurs during deserializationClassNotFoundException- if the class of the serialized object cannot be found
-
hashCode
public int hashCode() -
equals
-
toString
-