Class SerializedBiscuit
- java.lang.Object
-
- com.clevercloud.biscuit.token.format.SerializedBiscuit
-
public class SerializedBiscuit extends Object
Intermediate representation of a token before full serialization
-
-
Field Summary
Fields Modifier and Type Field Description SignedBlockauthorityList<SignedBlock>blocksstatic intMAX_SCHEMA_VERSIONstatic intMIN_SCHEMA_VERSIONProofproofio.vavr.control.Option<Integer>root_key_id
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.vavr.control.Either<Error.FormatError,SerializedBiscuit>append(KeyPair next, Block newBlock)static SerializedBiscuitfrom_bytes(byte[] slice, KeyDelegate delegate)Deserializes a SerializedBiscuit from a byte arraystatic SerializedBiscuitfrom_bytes(byte[] slice, PublicKey root)Deserializes a SerializedBiscuit from a byte arraystatic io.vavr.control.Either<Error.FormatError,SerializedBiscuit>make(KeyPair root, Block authority, KeyPair next)static io.vavr.control.Either<Error.FormatError,SerializedBiscuit>make(KeyPair root, io.vavr.control.Option<Integer> root_key_id, Block authority, KeyPair next)List<byte[]>revocation_identifiers()io.vavr.control.Either<Error,Void>seal()byte[]serialize()Serializes a SerializedBiscuit to a byte arraystatic SerializedBiscuitunsafe_deserialize(byte[] slice)Warning: this deserializes without verifying the signatureio.vavr.control.Either<Error,Void>verify(PublicKey root)
-
-
-
Field Detail
-
authority
public SignedBlock authority
-
blocks
public List<SignedBlock> blocks
-
proof
public Proof proof
-
root_key_id
public io.vavr.control.Option<Integer> root_key_id
-
MIN_SCHEMA_VERSION
public static int MIN_SCHEMA_VERSION
-
MAX_SCHEMA_VERSION
public static int MAX_SCHEMA_VERSION
-
-
Method Detail
-
from_bytes
public static SerializedBiscuit from_bytes(byte[] slice, PublicKey root) throws NoSuchAlgorithmException, SignatureException, InvalidKeyException, Error
Deserializes a SerializedBiscuit from a byte array- Parameters:
slice-- Returns:
- Throws:
NoSuchAlgorithmExceptionSignatureExceptionInvalidKeyExceptionError
-
from_bytes
public static SerializedBiscuit from_bytes(byte[] slice, KeyDelegate delegate) throws NoSuchAlgorithmException, SignatureException, InvalidKeyException, Error
Deserializes a SerializedBiscuit from a byte array- Parameters:
slice-- Returns:
- Throws:
NoSuchAlgorithmExceptionSignatureExceptionInvalidKeyExceptionError
-
unsafe_deserialize
public static SerializedBiscuit unsafe_deserialize(byte[] slice) throws Error.FormatError.DeserializationError
Warning: this deserializes without verifying the signature- Parameters:
slice-- Returns:
- SerializedBiscuit
- Throws:
Error.FormatError.DeserializationError
-
serialize
public byte[] serialize() throws Error.FormatError.SerializationErrorSerializes a SerializedBiscuit to a byte array- Returns:
- Throws:
Error.FormatError.SerializationError
-
make
public static io.vavr.control.Either<Error.FormatError,SerializedBiscuit> make(KeyPair root, Block authority, KeyPair next)
-
make
public static io.vavr.control.Either<Error.FormatError,SerializedBiscuit> make(KeyPair root, io.vavr.control.Option<Integer> root_key_id, Block authority, KeyPair next)
-
append
public io.vavr.control.Either<Error.FormatError,SerializedBiscuit> append(KeyPair next, Block newBlock)
-
verify
public io.vavr.control.Either<Error,Void> verify(PublicKey root) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException
-
seal
public io.vavr.control.Either<Error,Void> seal() throws InvalidKeyException, NoSuchAlgorithmException, SignatureException
-
revocation_identifiers
public List<byte[]> revocation_identifiers()
-
-