Skip to main content

SHARE KEY (bSQL) | Blockpoint Docs

Shares an existing key with another database user. For examples, see Examples.

bSQL Syntax Conventions

Syntax​

SHARE KEY "key_name" WITH <database_principal> 

<database_principal> ::=
Database_user
| Database_role

[IMPORTANT] Database principals in the SHARE KEY command are currently restricted to logins in the master database.

Arguments​

key_name
The name of the key to be shared.

database_principal
The user or role to receive access to the key.

Permissions​

Any user can share a key, but the user must have ownership of the key. Once shared, the target database principal can use the key to encrypt and decrypt blockchain data and files.

Examples​

Creating and sharing a key.​

The following example creates a new symmetric key named "shipKey", and shares the key with the user product_manager.

CREATE KEY 
SYMMETRIC "shipKey"
SHARE KEY
"shipKey" WITH product_manager

See Also​