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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
CryptoSigningKey.Builder
RecordBuilder for CryptoSigningKey instances.
-
Field Summary
Fields Modifier and Type Field Description public final static Schema
SCHEMA$
public String
id
public String
tenantId
public String
category
public String
alias
public String
hsmAlias
public ByteBuffer
publicKey
public String
schemeCodeName
public String
masterKeyAlias
public Integer
encodingVersion
public String
externalId
public Instant
created
-
Constructor Summary
Constructors Constructor Description CryptoSigningKey()
Default constructor. 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.
-
Method Summary
Modifier and Type Method Description String
getId()
Gets the value of the 'id' field. void
setId(String value)
Sets the value of the 'id' field. String
getTenantId()
Gets the value of the 'tenantId' field. void
setTenantId(String value)
Sets the value of the 'tenantId' field. String
getCategory()
Gets the value of the 'category' field. void
setCategory(String value)
Sets the value of the 'category' field. String
getAlias()
Gets the value of the 'alias' field. void
setAlias(String value)
Sets the value of the 'alias' field. String
getHsmAlias()
Gets the value of the 'hsmAlias' field. void
setHsmAlias(String value)
Sets the value of the 'hsmAlias' field. ByteBuffer
getPublicKey()
Gets the value of the 'publicKey' field. void
setPublicKey(ByteBuffer value)
Sets the value of the 'publicKey' field. String
getSchemeCodeName()
Gets the value of the 'schemeCodeName' field. void
setSchemeCodeName(String value)
Sets the value of the 'schemeCodeName' field. String
getMasterKeyAlias()
Gets the value of the 'masterKeyAlias' field. void
setMasterKeyAlias(String value)
Sets the value of the 'masterKeyAlias' field. Integer
getEncodingVersion()
Gets the value of the 'encodingVersion' field. void
setEncodingVersion(Integer value)
Sets the value of the 'encodingVersion' field. String
getExternalId()
Gets the value of the 'externalId' field. void
setExternalId(String value)
Sets the value of the 'externalId' field. Instant
getCreated()
Gets the value of the 'created' field. void
setCreated(Instant value)
Sets the value of the 'created' field. static Schema
getClassSchema()
static BinaryMessageEncoder<CryptoSigningKey>
getEncoder()
Return the BinaryMessageEncoder instance used by this class. static BinaryMessageDecoder<CryptoSigningKey>
getDecoder()
Return the BinaryMessageDecoder instance used by this class. static BinaryMessageDecoder<CryptoSigningKey>
createDecoder(SchemaStore resolver)
Create a new BinaryMessageDecoder instance for this class that uses the specified SchemaStore. ByteBuffer
toByteBuffer()
Serializes this CryptoSigningKey to a ByteBuffer. static CryptoSigningKey
fromByteBuffer(ByteBuffer b)
Deserializes a CryptoSigningKey from a ByteBuffer. SpecificData
getSpecificData()
Schema
getSchema()
Object
get(int field$)
Conversion<out Object>
getConversion(int field)
void
put(int field$, Object value$)
static CryptoSigningKey.Builder
newBuilder()
Creates a new CryptoSigningKey RecordBuilder. static CryptoSigningKey.Builder
newBuilder(CryptoSigningKey.Builder other)
Creates a new CryptoSigningKey RecordBuilder by copying an existing Builder. static CryptoSigningKey.Builder
newBuilder(CryptoSigningKey other)
Creates a new CryptoSigningKey RecordBuilder by copying an existing CryptoSigningKey instance. void
writeExternal(ObjectOutput out)
void
readExternal(ObjectInput in)
-
Methods inherited from class org.apache.avro.specific.SpecificRecordBase
compareTo, customDecode, customEncode, equals, hashCode, toString
-
Methods inherited from class org.apache.avro.generic.GenericRecord
hasField
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
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
-
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.
-
getClassSchema
static Schema getClassSchema()
-
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
-
getSpecificData
SpecificData getSpecificData()
-
getSchema
Schema getSchema()
-
getConversion
Conversion<out Object> getConversion(int field)
-
newBuilder
static CryptoSigningKey.Builder newBuilder()
Creates a new CryptoSigningKey RecordBuilder.
- Returns:
A new CryptoSigningKey RecordBuilder
-
newBuilder
static CryptoSigningKey.Builder newBuilder(CryptoSigningKey.Builder other)
Creates a new CryptoSigningKey RecordBuilder by copying an existing Builder.
- Parameters:
other
- The existing builder to copy.- Returns:
A new CryptoSigningKey RecordBuilder
-
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
-
writeExternal
void writeExternal(ObjectOutput out)
-
readExternal
void readExternal(ObjectInput in)
-
-
-
-