public final class AsymmetricKeyCredential extends Object
Modifier and Type | Field and Description |
---|---|
static int |
MIN_KEYSIZE_IN_BITS |
Modifier and Type | Method and Description |
---|---|
static AsymmetricKeyCredential |
create(String clientId,
InputStream pkcs12Certificate,
String password)
Static method to create KeyCredential instance.
|
static AsymmetricKeyCredential |
create(String clientId,
PrivateKey key,
X509Certificate publicCertificate)
Static method to create KeyCredential instance.
|
String |
getClientId()
Gets the identifier of the client requesting the token.
|
PrivateKey |
getKey()
Returns private key of the credential.
|
String |
getPublicCertificate()
Base64 encoded public certificate.
|
String |
getPublicCertificateHash()
Base64 encoded hash of the the public certificate.
|
public static final int MIN_KEYSIZE_IN_BITS
public String getClientId()
public String getPublicCertificateHash() throws CertificateEncodingException, NoSuchAlgorithmException
CertificateEncodingException
- if an encoding error occursNoSuchAlgorithmException
- if requested algorithm is not available in the environmentpublic String getPublicCertificate() throws CertificateEncodingException
CertificateEncodingException
- if an encoding error occurspublic PrivateKey getKey()
public static AsymmetricKeyCredential create(String clientId, InputStream pkcs12Certificate, String password) throws KeyStoreException, NoSuchProviderException, NoSuchAlgorithmException, CertificateException, IOException, UnrecoverableKeyException
clientId
- Identifier of the client requesting the token.pkcs12Certificate
- PKCS12 certificate stream containing public and private key.
Caller is responsible for handling the input stream.password
- certificate passwordKeyStoreException
- KeyStoreException
NoSuchProviderException
- NoSuchProviderException
NoSuchAlgorithmException
- NoSuchAlgorithmException
CertificateException
- CertificateException
IOException
- IOException
UnrecoverableKeyException
- UnrecoverableKeyException
public static AsymmetricKeyCredential create(String clientId, PrivateKey key, X509Certificate publicCertificate)
clientId
- Identifier of the client requesting the token.key
- RSA private key to sign the assertion.publicCertificate
- Public certificate used for thumb print.Copyright © 2013–2021. All rights reserved.