Class ProtoKeySerialization

  • All Implemented Interfaces:
    Serialization

    @Immutable
    public final class ProtoKeySerialization
    extends java.lang.Object
    implements Serialization
    * Represents a Key object serialized with binary protobuf Serialization.

    ProtoKeySerialization objects fully describe a Key object, but tailored for protocol buffer serialization.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ProtoKeySerialization create​(java.lang.String typeUrl, com.google.protobuf.ByteString value, com.google.crypto.tink.proto.KeyData.KeyMaterialType keyMaterialType, com.google.crypto.tink.proto.OutputPrefixType outputPrefixType, java.lang.Integer idRequirement)  
      java.lang.Integer getIdRequirementOrNull()
      The id requirement of this key.
      com.google.crypto.tink.proto.KeyData.KeyMaterialType getKeyMaterialType()
      The contents of the field key_material_type in the message com.google.crypto.tink.proto.KeyData.
      Bytes getObjectIdentifier()
      The object identifier.
      com.google.crypto.tink.proto.OutputPrefixType getOutputPrefixType()
      The contents of the field output_prefix_type in the message com.google.crypto.tink.proto.Keyset.Key.
      java.lang.String getTypeUrl()
      The typeUrl.
      com.google.protobuf.ByteString getValue()
      The contents of the field value in the message com.google.crypto.tink.proto.KeyData.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • create

        public static ProtoKeySerialization create​(java.lang.String typeUrl,
                                                   com.google.protobuf.ByteString value,
                                                   com.google.crypto.tink.proto.KeyData.KeyMaterialType keyMaterialType,
                                                   com.google.crypto.tink.proto.OutputPrefixType outputPrefixType,
                                                   @Nullable
                                                   java.lang.Integer idRequirement)
                                            throws java.security.GeneralSecurityException
        Throws:
        java.security.GeneralSecurityException
      • getValue

        public com.google.protobuf.ByteString getValue()
        The contents of the field value in the message com.google.crypto.tink.proto.KeyData.
      • getKeyMaterialType

        public com.google.crypto.tink.proto.KeyData.KeyMaterialType getKeyMaterialType()
        The contents of the field key_material_type in the message com.google.crypto.tink.proto.KeyData.
      • getOutputPrefixType

        public com.google.crypto.tink.proto.OutputPrefixType getOutputPrefixType()
        The contents of the field output_prefix_type in the message com.google.crypto.tink.proto.Keyset.Key.
      • getIdRequirementOrNull

        @Nullable
        public java.lang.Integer getIdRequirementOrNull()
        The id requirement of this key. Guaranteed to be null if getOutputPrefixType == RAW, otherwise non-null, and equal to the ID this key has to have.
      • getObjectIdentifier

        public Bytes getObjectIdentifier()
        The object identifier.

        This is the UTF8 encoding of the result of "getTypeUrl".

        Specified by:
        getObjectIdentifier in interface Serialization
      • getTypeUrl

        public java.lang.String getTypeUrl()
        The typeUrl.