Get the SSH key for a credential
GET/api/v1/Credential/GetCredentialSSHCertificate/:credentialId
Returns the SSH key settings for one SSH key credential, including the private key, public key and passphrase in plain text. Use it when you need to retrieve the key material.
Permission required: Admin or App role.
Values for AuthenticationMethodType: 0 = Password, 1 = SshCertificate, 2 = SshCertificateAndPassword.
Values for CredentialType: -1 = Any, 0 = Configuration, 1 = User, 2 = Service, 3 = ActivityToken, 4 = Application, 5 = VaultUser, 6 = SshKeyCert.
Caution: The response contains the private key and passphrase in plain text, so protect it and do not log it.
Request
Responses
- 200
- 400
- 403
- 404
The body wraps the key settings: value holds the credential ID, type, authentication method, key settings, private key, passphrase, public key and sudo command, and statusCode is 200. The other wrapper properties are empty.
The key could not be read. The body describes the problem.
The signed-in user does not have the required role.
No credential of the SSH key type exists with that ID.