java.lang.Object
io.lettuce.core.codec.CipherCodec.KeyDescriptor
- Enclosing class:
- CipherCodec
public static class CipherCodec.KeyDescriptor extends Object
Descriptor to determine which crypto key to use. Allows versioning and usage of named keys. Key names must not contain
dollar
$ or plus + characters as these characters are used within the message format to encode key name
and key version.-
Method Summary
Modifier and Type Method Description static CipherCodec.KeyDescriptorcreate(String name)Create a namedCipherCodec.KeyDescriptorwithout version.static CipherCodec.KeyDescriptorcreate(String name, int version)Create a named and versionedCipherCodec.KeyDescriptor.static CipherCodec.KeyDescriptorcreate(String name, int version, Charset charset)Create a named and versionedCipherCodec.KeyDescriptorusingCharsetto encodenameto its binary representation.StringgetName()Returns the keynameby decoding name bytes using thedefault charset.StringgetName(Charset charset)Returns the keynameby decoding name bytes using the givenCharset.intgetVersion()static CipherCodec.KeyDescriptorunnamed()Returns the defaultCipherCodec.KeyDescriptorthat has no specified name.
-
Method Details
-
unnamed
Returns the defaultCipherCodec.KeyDescriptorthat has no specified name.- Returns:
- the default
CipherCodec.KeyDescriptor.
-
create
Create a namedCipherCodec.KeyDescriptorwithout version. Version defaults to zero.- Parameters:
name- the key name. Must not contain plus or dollar character.- Returns:
- the
CipherCodec.KeyDescriptorforname.
-
create
Create a named and versionedCipherCodec.KeyDescriptor.- Parameters:
name- the key name. Must not contain plus or dollar character.version- the key version.- Returns:
- the
CipherCodec.KeyDescriptorforname.
-
create
Create a named and versionedCipherCodec.KeyDescriptorusingCharsetto encodenameto its binary representation.- Parameters:
name- the key name. Must not contain plus or dollar character.version- the key version.charset- must not benull.- Returns:
- the
CipherCodec.KeyDescriptorforname.
-
getVersion
public int getVersion() -
getName
Returns the keynameby decoding name bytes using thedefault charset.- Returns:
- the key name.
-
getName
Returns the keynameby decoding name bytes using the givenCharset.- Parameters:
charset- theCharsetto use to decode the key name, must not benull.- Returns:
- the key name.
-