Class CryptoSigningKey

  • All Implemented Interfaces:
    java.io.Externalizable , java.io.Serializable , java.lang.Comparable , org.apache.avro.generic.GenericContainer , org.apache.avro.generic.GenericRecord , org.apache.avro.generic.IndexedRecord , org.apache.avro.specific.SpecificRecord

    
    public class CryptoSigningKey
    extends SpecificRecordBase implements SpecificRecord
                        

    Defines a signing key information.

    • Constructor Detail

      • CryptoSigningKey

        CryptoSigningKey()
        Default constructor.
      • CryptoSigningKey

        CryptoSigningKey(String id, String tenantId, String category, String alias, String hsmAlias, ByteBuffer publicKey, String schemeCodeName, String masterKeyAlias, Integer encodingVersion, String externalId, Instant created)
        All-args constructor.
        Parameters:
        id - The key's id.
        tenantId - The key owner.
        category - The key's category, such as TLS, LEDGER, etc.
        alias - Key's alias as defined by the tenant, the wrapped keys will have this value as null.
        hsmAlias - Key's alias which is used by the HSM, the wrapped keys will have this value as null.
        publicKey - Serialized public key.
        schemeCodeName - The key's signature scheme code.
        masterKeyAlias - For wrapped keys only, the master's key alias.
        encodingVersion - Encoding protocol version.
        externalId - External id associated with the key.
        created - Time ([Instant]) in milliseconds when the record was created.
    • Method Detail

      • getId

         String getId()

        Gets the value of the 'id' field.

        Returns:

        The key's id.

      • setId

         void setId(String value)

        Sets the value of the 'id' field. The key's id.

        Parameters:
        value - the value to set.
      • getTenantId

         String getTenantId()

        Gets the value of the 'tenantId' field.

        Returns:

        The key owner.

      • setTenantId

         void setTenantId(String value)

        Sets the value of the 'tenantId' field. The key owner.

        Parameters:
        value - the value to set.
      • getCategory

         String getCategory()

        Gets the value of the 'category' field.

        Returns:

        The key's category, such as TLS, LEDGER, etc.

      • setCategory

         void setCategory(String value)

        Sets the value of the 'category' field. The key's category, such as TLS, LEDGER, etc.

        Parameters:
        value - the value to set.
      • getAlias

         String getAlias()

        Gets the value of the 'alias' field.

        Returns:

        Key's alias as defined by the tenant, the wrapped keys will have this value as null.

      • setAlias

         void setAlias(String value)

        Sets the value of the 'alias' field. Key's alias as defined by the tenant, the wrapped keys will have this value as null.

        Parameters:
        value - the value to set.
      • getHsmAlias

         String getHsmAlias()

        Gets the value of the 'hsmAlias' field.

        Returns:

        Key's alias which is used by the HSM, the wrapped keys will have this value as null.

      • setHsmAlias

         void setHsmAlias(String value)

        Sets the value of the 'hsmAlias' field. Key's alias which is used by the HSM, the wrapped keys will have this value as null.

        Parameters:
        value - the value to set.
      • getPublicKey

         ByteBuffer getPublicKey()

        Gets the value of the 'publicKey' field.

        Returns:

        Serialized public key.

      • setPublicKey

         void setPublicKey(ByteBuffer value)

        Sets the value of the 'publicKey' field. Serialized public key.

        Parameters:
        value - the value to set.
      • getSchemeCodeName

         String getSchemeCodeName()

        Gets the value of the 'schemeCodeName' field.

        Returns:

        The key's signature scheme code.

      • setSchemeCodeName

         void setSchemeCodeName(String value)

        Sets the value of the 'schemeCodeName' field. The key's signature scheme code.

        Parameters:
        value - the value to set.
      • getMasterKeyAlias

         String getMasterKeyAlias()

        Gets the value of the 'masterKeyAlias' field.

        Returns:

        For wrapped keys only, the master's key alias.

      • setMasterKeyAlias

         void setMasterKeyAlias(String value)

        Sets the value of the 'masterKeyAlias' field. For wrapped keys only, the master's key alias.

        Parameters:
        value - the value to set.
      • getEncodingVersion

         Integer getEncodingVersion()

        Gets the value of the 'encodingVersion' field.

        Returns:

        Encoding protocol version.

      • setEncodingVersion

         void setEncodingVersion(Integer value)

        Sets the value of the 'encodingVersion' field. Encoding protocol version.

        Parameters:
        value - the value to set.
      • getExternalId

         String getExternalId()

        Gets the value of the 'externalId' field.

        Returns:

        External id associated with the key.

      • setExternalId

         void setExternalId(String value)

        Sets the value of the 'externalId' field. External id associated with the key.

        Parameters:
        value - the value to set.
      • getCreated

         Instant getCreated()

        Gets the value of the 'created' field.

        Returns:

        Time ([Instant]) in milliseconds when the record was created.

      • setCreated

         void setCreated(Instant value)

        Sets the value of the 'created' field. Time ([Instant]) in milliseconds when the record was created.

        Parameters:
        value - the value to set.
      • getEncoder

         static BinaryMessageEncoder<CryptoSigningKey> getEncoder()

        Return the BinaryMessageEncoder instance used by this class.

        Returns:

        the message encoder used by this class

      • getDecoder

         static BinaryMessageDecoder<CryptoSigningKey> getDecoder()

        Return the BinaryMessageDecoder instance used by this class.

        Returns:

        the message decoder used by this class

      • createDecoder

         static BinaryMessageDecoder<CryptoSigningKey> createDecoder(SchemaStore resolver)

        Create a new BinaryMessageDecoder instance for this class that uses the specified SchemaStore.

        Parameters:
        resolver - a SchemaStore used to find schemas by fingerprint
        Returns:

        a BinaryMessageDecoder instance for this class backed by the given SchemaStore

      • toByteBuffer

         ByteBuffer toByteBuffer()

        Serializes this CryptoSigningKey to a ByteBuffer.

        Returns:

        a buffer holding the serialized data for this instance

      • fromByteBuffer

         static CryptoSigningKey fromByteBuffer(ByteBuffer b)

        Deserializes a CryptoSigningKey from a ByteBuffer.

        Parameters:
        b - a byte buffer holding serialized data for an instance of this class
        Returns:

        a CryptoSigningKey instance decoded from the given buffer

      • newBuilder

         static CryptoSigningKey.Builder newBuilder(CryptoSigningKey other)

        Creates a new CryptoSigningKey RecordBuilder by copying an existing CryptoSigningKey instance.

        Parameters:
        other - The existing instance to copy.
        Returns:

        A new CryptoSigningKey RecordBuilder