Package com.clevercloud.biscuit.token
Class UnverifiedBiscuit
- java.lang.Object
-
- com.clevercloud.biscuit.token.UnverifiedBiscuit
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description UnverifiedBiscuitattenuate(Block block)Generates a new token from an existing one and a new blockUnverifiedBiscuitattenuate(SecureRandom rng, KeyPair keypair, Block block)Generates a new token from an existing one and a new blockList<List<Check>>checks()protected Objectclone()List<io.vavr.control.Option<String>>context()UnverifiedBiscuitcopy()Blockcreate_block()Creates a Block builderstatic SymbolTabledefault_symbol_table()Default symbols liststatic UnverifiedBiscuitfrom_b64url(String data)Deserializes a Biscuit token from a base64 url (RFC4648_URLSAFE) stringstatic UnverifiedBiscuitfrom_bytes(byte[] data)Deserializes a Biscuit token from a byte arraystatic UnverifiedBiscuitfrom_bytes_with_symbols(byte[] data, SymbolTable symbols)Deserializes a UnverifiedBiscuit from a byte arrayStringprint()Prints a token's contentList<RevocationIdentifier>revocation_identifiers()io.vavr.control.Option<Integer>root_key_id()byte[]serialize()Serializes a token to a byte arrayStringserialize_b64url()Serializes a token to base 64 url String using RFC4648_URLSAFEBiscuitverify(KeyDelegate delegate)Biscuitverify(PublicKey publicKey)
-
-
-
Method Detail
-
from_b64url
public static UnverifiedBiscuit from_b64url(String data) throws Error
Deserializes a Biscuit token from a base64 url (RFC4648_URLSAFE) stringThis method uses the default symbol table
- Parameters:
data-- Returns:
- Biscuit
- Throws:
Error
-
from_bytes
public static UnverifiedBiscuit from_bytes(byte[] data) throws Error
Deserializes a Biscuit token from a byte arrayThis method uses the default symbol table
- Parameters:
data-- Returns:
- Throws:
Error
-
from_bytes_with_symbols
public static UnverifiedBiscuit from_bytes_with_symbols(byte[] data, SymbolTable symbols) throws Error
Deserializes a UnverifiedBiscuit from a byte array- Parameters:
data-- Returns:
- UnverifiedBiscuit
- Throws:
Error
-
serialize
public byte[] serialize() throws Error.FormatError.SerializationErrorSerializes a token to a byte array- Returns:
- Throws:
Error.FormatError.SerializationError
-
serialize_b64url
public String serialize_b64url() throws Error.FormatError.SerializationError
Serializes a token to base 64 url String using RFC4648_URLSAFE- Returns:
- String
- Throws:
Error.FormatError.SerializationError
-
create_block
public Block create_block()
Creates a Block builder- Returns:
-
attenuate
public UnverifiedBiscuit attenuate(Block block) throws NoSuchAlgorithmException, SignatureException, InvalidKeyException, Error
Generates a new token from an existing one and a new block- Parameters:
block- new block (should be generated from a Block builder)- Returns:
- Throws:
NoSuchAlgorithmExceptionSignatureExceptionInvalidKeyExceptionError
-
attenuate
public UnverifiedBiscuit attenuate(SecureRandom rng, KeyPair keypair, Block block) throws Error
Generates a new token from an existing one and a new block- Parameters:
rng- random number generatorkeypair- ephemeral key pairblock- new block (should be generated from a Block builder)- Returns:
- Throws:
Error
-
revocation_identifiers
public List<RevocationIdentifier> revocation_identifiers()
-
root_key_id
public io.vavr.control.Option<Integer> root_key_id()
-
print
public String print()
Prints a token's content
-
default_symbol_table
public static SymbolTable default_symbol_table()
Default symbols list
-
clone
protected Object clone() throws CloneNotSupportedException
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
copy
public UnverifiedBiscuit copy() throws Error
- Throws:
Error
-
verify
public Biscuit verify(PublicKey publicKey) throws Error, NoSuchAlgorithmException, SignatureException, InvalidKeyException
-
verify
public Biscuit verify(KeyDelegate delegate) throws Error, NoSuchAlgorithmException, SignatureException, InvalidKeyException
-
-