Skip to content

Instantly share code, notes, and snippets.

@divarvel
Created July 22, 2021 18:27
Show Gist options
  • Save divarvel/b2b2cc8a3f5b309b7d4122f07a2f4b2c to your computer and use it in GitHub Desktop.
Save divarvel/b2b2cc8a3f5b309b7d4122f07a2f4b2c to your computer and use it in GitHub Desktop.
❯ biscuit keypair
Generating a new random keypair
Private key: 53a4d7e7c10b186135b43fe231fa5f91923571a9619654091a23a5ae09d45d08
Public key: d0def12aeaaccd02cdfbab78f41e833085606e4dde78614a7e4bc87bc64a6126
❯ biscuit keypair --from-private-key 53a4d7e7c10b186135b43fe231fa5f91923571a9619654091a23a5ae09d45d08
Generating a keypair for the provided private key
Private key: 53a4d7e7c10b186135b43fe231fa5f91923571a9619654091a23a5ae09d45d08
Public key: d0def12aeaaccd02cdfbab78f41e833085606e4dde78614a7e4bc87bc64a6126
❯ biscuit keypair --from-private-key 53a4d7e7c10b186135b43fe231fa5f91923571a9619654091a23a5ae09d45d08^C
❯ echo "53a4d7e7c10b186135b43fe231fa5f91923571a9619654091a23a5ae09d45d08" | biscuit keypair --from-private-key-file - --only-public-key
d0def12aeaaccd02cdfbab78f41e833085606e4dde78614a7e4bc87bc64a6126
❯ echo "right(#authority, true);" | biscuit generate --private-key-file ./private-key-file -
ChIIADgBQgwKCggEEgIIABICOAEaIGSTAMyKhcv5c5lMPEMks13IhmZlep_uhHrOR2U6zyoJIkQKIO6hIooNBUqC5Alne8WQqlRZFUpOK0Flxmzi5O3nG2wgEiAYpuRCPDHgcjiiMDXY7hUv3OYdF9Egw-g-BxTooMKpCQ==
❯ echo "right(#authority, true);" | biscuit generate --private-key-file ./private-key-file - | biscuit inspect -
Biscuit {
symbols: ["authority", "ambient", "resource", "operation", "right", "current_time", "revocation_id"]
authority: Block[0] {
symbols: []
version: 1
context: ""
facts: [
right(#authority, true)
]
rules: []
checks: []
}
blocks: [
]
}
❯ echo "right(#authority, true);" | biscuit generate --private-key-file ./private-key-file - | biscuit inspect - --public-key-file ./public-key-file
Biscuit {
symbols: ["authority", "ambient", "resource", "operation", "right", "current_time", "revocation_id"]
authority: Block[0] {
symbols: []
version: 1
context: ""
facts: [
right(#authority, true)
]
rules: []
checks: []
}
blocks: [
]
}
Public key check succeeded
❯ echo "right(#authority, true);" | biscuit generate --private-key-file ./private-key-file - | biscuit attenuate - --block 'test(true);'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment