public final class X509CertificateUtils extends Object
Modifier and Type | Method | Description |
---|---|---|
static boolean |
hasMatchingIssuerAndSubject(X509Certificate cert) |
Checks if the issuer DN and the subject DN of the specified X.509
certificate match.
|
static boolean |
hasValidSignature(X509Certificate cert,
PublicKey pubKey) |
Validates the signature of a X.509 certificate with the specified
public key.
|
static boolean |
isSelfIssued(X509Certificate cert) |
Checks if the specified X.509 certificate is self-issued, i.e.
|
static boolean |
isSelfSigned(X509Certificate cert) |
Checks if the specified X.509 certificate is self-signed, i.e.
|
static boolean |
publicKeyMatches(X509Certificate cert,
PublicKey pubKey) |
Returns
true if the public key of the X.509 certificate
matches the specified public key. |
public static boolean hasMatchingIssuerAndSubject(X509Certificate cert)
cert
- The X.509 certificate. Must not be null
.true
if the issuer DN and and subject DN match, else
false
.public static boolean isSelfIssued(X509Certificate cert)
cert
- The X.509 certificate. Must not be null
.true
if the X.509 certificate is self-issued, else
false
.public static boolean isSelfSigned(X509Certificate cert)
cert
- The X.509 certificate. Must not be null
.true
if the X.509 certificate is self-signed, else
false
.public static boolean hasValidSignature(X509Certificate cert, PublicKey pubKey)
cert
- The X.509 certificate. Must not be null
.pubKey
- The public key to use for the validation. Must not be
null
.true
if the signature is valid, else false
.public static boolean publicKeyMatches(X509Certificate cert, PublicKey pubKey)
true
if the public key of the X.509 certificate
matches the specified public key.cert
- The X.509 certificate. Must not be null
.pubKey
- The public key to compare. Must not be null
.true
if the two public keys match, else
false
.Copyright © 2019 Connect2id Ltd.. All rights reserved.