public final class CryptoFormat extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
LEGACY_PREFIX_SIZE
Legacy or Crunchy prefix starts with \x00 and followed by a 4-byte key id.
|
static byte |
LEGACY_START_BYTE |
static int |
NON_RAW_PREFIX_SIZE
Prefix size of Tink, Legacy and Crunchy output prefix types.
|
static byte[] |
RAW_PREFIX |
static int |
RAW_PREFIX_SIZE
Raw prefix is empty.
|
static int |
TINK_PREFIX_SIZE
Tink prefix starts with \x01 and followed by a 4-byte key id.
|
static byte |
TINK_START_BYTE |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
getOutputPrefix(Keyset.Key key)
Generates the prefix of all cryptographic outputs (ciphertexts, signatures, MACs, ...) produced
by the specified
key. |
public static final int NON_RAW_PREFIX_SIZE
public static final int LEGACY_PREFIX_SIZE
public static final byte LEGACY_START_BYTE
public static final int TINK_PREFIX_SIZE
public static final byte TINK_START_BYTE
public static final int RAW_PREFIX_SIZE
public static final byte[] RAW_PREFIX
public static byte[] getOutputPrefix(Keyset.Key key) throws GeneralSecurityException
key. The prefix can be either empty (for RAW-type prefix), or consists
of a 1-byte indicator of the type of the prefix, followed by 4 bytes of key.key_id in
Big Endian encoding.GeneralSecurityException - if the prefix type of key is unknown.