public static final class SerializationRegistry.Builder extends Object
| Constructor and Description |
|---|
Builder() |
Builder(SerializationRegistry registry) |
public Builder()
public Builder(SerializationRegistry registry)
@CanIgnoreReturnValue public <KeyT extends Key,SerializationT extends Serialization> SerializationRegistry.Builder registerKeySerializer(KeySerializer<KeyT,SerializationT> serializer) throws GeneralSecurityException
SerializationRegistry.serializeKey(KeyT, java.lang.Class<SerializationT>, com.google.crypto.tink.SecretKeyAccess).
This registers a key serializer which can later be used to serialize a key by calling
SerializationRegistry.serializeKey(KeyT, java.lang.Class<SerializationT>, com.google.crypto.tink.SecretKeyAccess). If a serializer for the pair (KeyT, SerializationT) has
already been registered, this checks if they are the same. If they are, the call is ignored,
otherwise an exception is thrown.
GeneralSecurityException@CanIgnoreReturnValue public <SerializationT extends Serialization> SerializationRegistry.Builder registerKeyParser(KeyParser<SerializationT> parser) throws GeneralSecurityException
SerializationRegistry.parseKey(SerializationT, com.google.crypto.tink.SecretKeyAccess).
This registers a key serializer which can later be used to serialize a key by calling
SerializationRegistry.parseKey(SerializationT, com.google.crypto.tink.SecretKeyAccess). If a parser for the pair (SerializationT,
parser.getObjectIdentifier()) has already been registered, this checks if they are the same.
If they are, the call is ignored, otherwise an exception is thrown.
GeneralSecurityException@CanIgnoreReturnValue public <ParametersT extends Parameters,SerializationT extends Serialization> SerializationRegistry.Builder registerParametersSerializer(ParametersSerializer<ParametersT,SerializationT> serializer) throws GeneralSecurityException
SerializationRegistry.serializeKey(KeyT, java.lang.Class<SerializationT>, com.google.crypto.tink.SecretKeyAccess).
This registers a key serializer which can later be used to serialize a key by calling
SerializationRegistry.serializeKey(KeyT, java.lang.Class<SerializationT>, com.google.crypto.tink.SecretKeyAccess). If a serializer for the pair (KeyT, SerializationT) has
already been registered, this checks if they are the same. If they are, the call is ignored,
otherwise an exception is thrown.
GeneralSecurityException@CanIgnoreReturnValue public <SerializationT extends Serialization> SerializationRegistry.Builder registerParametersParser(ParametersParser<SerializationT> parser) throws GeneralSecurityException
SerializationRegistry.parseKey(SerializationT, com.google.crypto.tink.SecretKeyAccess).
This registers a key serializer which can later be used to serialize a key by calling
SerializationRegistry.parseKey(SerializationT, com.google.crypto.tink.SecretKeyAccess). If a parser for the pair (SerializationT,
parser.getObjectIdentifier()) has already been registered, this checks if they are the same.
If they are, the call is ignored, otherwise an exception is thrown.
GeneralSecurityExceptionpublic SerializationRegistry build()