-
Notifications
You must be signed in to change notification settings - Fork 28
Configuration Credentials Keys and Encryption
In order to identify a user, the java-manta client requires a minimum of a username, private key, and private key ID. This private key is provided to the java-http-signature library in order to authorize requests against manta while the key fingerprint is used to verify that the loaded key is the key expected by the user.
We'll start with an empty StandardConfigContext:
ConfigContext config = new StandardConfigContext();When configuring the client to identify as a sub-user, remember to include the account owner as well as the sub-user, e.g. yourorganization/youruser. Let's assume we're working with a sub-user:
config.setMantaUser("yourorganization/youruser");The private key may be set in one of two ways: either as a path to the key or by providing the raw key content. The latter is less commonly used but is provided in case writing to the local filesystem is inconvenient or impossible for any reason. Specifying a path to our private key:
config.setMantaKeyPath("/home/usersvc/.ssh/id_rsa");As described in the Getting Started guide introducing the ConfigContext classes the private key fingerprint, or private key ID, can be acquired either from the Triton Portal or calculated locally using ssh-keygen -l. Note that the key ID can be specified in either SHA256 or MD5 formats with or without the leading prefix. The key ID (or fingerprint) can be found using ssh-keygen -l -f ./path/to/manta/key and is prefixed with either SHA256: or MD5: in the ssh-keygen output to indicate which algorithm was used to generate the fingerprint.
config.setMantaKeyId("5b:7e:fd:27:2e:8c:4c:3a:0e:6e:07:24:f8:62:8c:b9");
/*
any of the following values would also be accepted:
"MD5:5b:7e:fd:27:2e:8c:4c:3a:0e:6e:07:24:f8:62:8c:b9"
"V1S2/yTakPV9bZwZAiFKSpRPC1nwHEY4ylDhtwBfmaA"
"SHA256:V1S2/yTakPV9bZwZAiFKSpRPC1nwHEY4ylDhtwBfmaA"
*/TODO