Package com.google.crypto.tink.hybrid
Class HybridPrivateKey
- java.lang.Object
-
- com.google.crypto.tink.Key
-
- com.google.crypto.tink.hybrid.HybridPrivateKey
-
- All Implemented Interfaces:
PrivateKey
- Direct Known Subclasses:
EciesPrivateKey,HpkePrivateKey
@Immutable public abstract class HybridPrivateKey extends Key implements PrivateKey
Representation of the decryption function for a hybrid encryption primitive.The encryption function is available via
getPublicKey().
-
-
Constructor Summary
Constructors Constructor Description HybridPrivateKey()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.IntegergetIdRequirementOrNull()Returns null if this key has no id requirement, otherwise the required id.BytesgetOutputPrefix()Returns aBytesinstance, which is prefixed to every ciphertext.HybridParametersgetParameters()Returns aParametersobject containing all the information about the key which is not randomly chosen.abstract HybridPublicKeygetPublicKey()
-
-
-
Method Detail
-
getPublicKey
public abstract HybridPublicKey getPublicKey()
- Specified by:
getPublicKeyin interfacePrivateKey
-
getOutputPrefix
public final Bytes getOutputPrefix()
Returns aBytesinstance, which is prefixed to every ciphertext.Returns the same as
getPublicKey().getOutputPrefix().
-
getIdRequirementOrNull
@Nullable public java.lang.Integer getIdRequirementOrNull()
Description copied from class:KeyReturns null if this key has no id requirement, otherwise the required id.Some keys, when they are in a keyset, are required to have a certain ID to work properly. This comes from the fact that Tink in some cases prefixes ciphertexts or signatures with the string
0x01<id>, where the ID is encoded in big endian (see the documentation of the key type for details), in which case the key requires a certain ID.- Specified by:
getIdRequirementOrNullin classKey
-
getParameters
public HybridParameters getParameters()
Description copied from class:KeyReturns aParametersobject containing all the information about the key which is not randomly chosen.Implementations need to ensure that
getParameters().hasIdRequirement()returns true if and only ifgetIdRequirementOrNullis non-null.- Specified by:
getParametersin classKey
-
-