AsymmetricKeyCredential Class
- java.
lang. Object - com.
microsoft. aad. adal4j. AsymmetricKeyCredential
- com.
public class AsymmetricKeyCredential
Credential type containing X509 public certificate and RSA private key.
Field Summary
Modifier and Type | Field and Description |
---|---|
final int | MIN_KEYSIZE_IN_BITS |
Method Summary
Modifier and Type | Method and Description |
---|---|
Asymmetric |
create(final String clientId, final InputStream pkcs12Certificate, final String password)
Static method to create KeyCredential instance. |
Asymmetric |
create(final String clientId, final PrivateKey key, final 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. |
Field Details
MIN_KEYSIZE_IN_BITS
public static final int MIN_KEYSIZE_IN_BITS= 2048
Method Details
create
public static AsymmetricKeyCredential create(final String clientId, final InputStream pkcs12Certificate, final String password)
Static method to create KeyCredential instance.
Parameters:
Returns:
Throws:
KeyStoreException
NoSuchProviderException
NoSuchAlgorithmException
CertificateException
IOException
UnrecoverableKeyException
create
public static AsymmetricKeyCredential create(final String clientId, final PrivateKey key, final X509Certificate publicCertificate)
Static method to create KeyCredential instance.
Parameters:
Returns:
getClientId
public String getClientId()
Gets the identifier of the client requesting the token.
Returns:
getKey
public PrivateKey getKey()
Returns private key of the credential.
Returns:
getPublicCertificate
public String getPublicCertificate()
Base64 encoded public certificate.
Returns:
Throws:
getPublicCertificateHash
public String getPublicCertificateHash()
Base64 encoded hash of the the public certificate.
Returns:
Throws:
Applies to
Azure SDK for Java
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for