Methods Summary |
---|
public java.util.Set | getCriticalExtensionOIDs()
if (extensions == null) {
return null;
}
return extensions.getCriticalExtensions();
|
public byte[] | getEncoded()
if (encoding == null) {
encoding = crl.getEncoded();
}
byte[] result = new byte[encoding.length];
System.arraycopy(encoding, 0, result, 0, encoding.length);
return result;
|
public byte[] | getExtensionValue(java.lang.String oid)
if (extensions == null) {
return null;
}
Extension ext = extensions.getExtensionByOID(oid);
return (ext == null) ? null : ext.getRawExtnValue();
|
public java.security.Principal | getIssuerDN()
if (issuer == null) {
issuer = tbsCertList.getIssuer().getX500Principal();
}
return issuer;
|
public javax.security.auth.x500.X500Principal | getIssuerX500Principal()
if (issuer == null) {
issuer = tbsCertList.getIssuer().getX500Principal();
}
return issuer;
|
public java.util.Date | getNextUpdate()
return tbsCertList.getNextUpdate();
|
public java.util.Set | getNonCriticalExtensionOIDs()
if (extensions == null) {
return null;
}
return extensions.getNonCriticalExtensions();
|
public java.security.cert.X509CRLEntry | getRevokedCertificate(java.security.cert.X509Certificate certificate)Searches for certificate in CRL.
This method supports indirect CRLs: if CRL is indirect method takes
into account serial number and issuer of the certificate,
if CRL issued by CA (i.e. it is not indirect) search is done only
by serial number of the specified certificate.
if (certificate == null) {
throw new NullPointerException();
}
if (!entriesRetrieved) {
retirieveEntries();
}
if (entries == null) {
return null;
}
BigInteger serialN = certificate.getSerialNumber();
if (isIndirectCRL) {
// search in indirect crl
X500Principal certIssuer = certificate.getIssuerX500Principal();
if (certIssuer.equals(getIssuerX500Principal())) {
// certificate issuer is CRL issuer
certIssuer = null;
}
for (int i=0; i<entriesSize; i++) {
X509CRLEntry entry = (X509CRLEntry) entries.get(i);
// check the serial number of revoked certificate
if (serialN.equals(entry.getSerialNumber())) {
// revoked certificate issuer
X500Principal iss = entry.getCertificateIssuer();
// check the issuer of revoked certificate
if (certIssuer != null) {
// certificate issuer is not a CRL issuer, so
// check issuers for equality
if (certIssuer.equals(iss)) {
return entry;
}
} else if (iss == null) {
// both certificates was issued by CRL issuer
return entry;
}
}
}
} else {
// search in CA's (non indirect) crl: just look up the serial number
for (int i=0; i<entriesSize; i++) {
X509CRLEntry entry = (X509CRLEntry) entries.get(i);
if (serialN.equals(entry.getSerialNumber())) {
return entry;
}
}
}
return null;
|
public java.security.cert.X509CRLEntry | getRevokedCertificate(java.math.BigInteger serialNumber)Method searches for CRL entry with specified serial number.
The method will search only certificate issued by CRL's issuer.
if (!entriesRetrieved) {
retirieveEntries();
}
if (entries == null) {
return null;
}
for (int i=0; i<nonIndirectEntriesSize; i++) {
X509CRLEntry entry = (X509CRLEntry) entries.get(i);
if (serialNumber.equals(entry.getSerialNumber())) {
return entry;
}
}
return null;
|
public java.util.Set | getRevokedCertificates()
if (!entriesRetrieved) {
retirieveEntries();
}
if (entries == null) {
return null;
}
return new HashSet(entries);
|
public java.lang.String | getSigAlgName()
if (sigAlgOID == null) {
sigAlgOID = tbsCertList.getSignature().getAlgorithm();
sigAlgName = AlgNameMapper.map2AlgName(sigAlgOID);
if (sigAlgName == null) {
sigAlgName = sigAlgOID;
}
}
return sigAlgName;
|
public java.lang.String | getSigAlgOID()
if (sigAlgOID == null) {
sigAlgOID = tbsCertList.getSignature().getAlgorithm();
sigAlgName = AlgNameMapper.map2AlgName(sigAlgOID);
if (sigAlgName == null) {
sigAlgName = sigAlgOID;
}
}
return sigAlgOID;
|
public byte[] | getSigAlgParams()
if (nullSigAlgParams) {
return null;
}
if (sigAlgParams == null) {
sigAlgParams = tbsCertList.getSignature().getParameters();
if (sigAlgParams == null) {
nullSigAlgParams = true;
return null;
}
}
return sigAlgParams;
|
public byte[] | getSignature()
if (signature == null) {
signature = crl.getSignatureValue();
}
byte[] result = new byte[signature.length];
System.arraycopy(signature, 0, result, 0, signature.length);
return result;
|
public byte[] | getTBSCertList()
if (tbsCertListEncoding == null) {
tbsCertListEncoding = tbsCertList.getEncoded();
}
byte[] result = new byte[tbsCertListEncoding.length];
System.arraycopy(tbsCertListEncoding, 0,
result, 0, tbsCertListEncoding.length);
return result;
|
public java.util.Date | getThisUpdate()
return tbsCertList.getThisUpdate();
|
public int | getVersion()
return tbsCertList.getVersion();
|
public boolean | hasUnsupportedCriticalExtension()
if (extensions == null) {
return false;
}
return extensions.hasUnsupportedCritical();
|
public boolean | isRevoked(java.security.cert.Certificate cert)
if (!(cert instanceof X509Certificate)) {
return false;
}
return getRevokedCertificate((X509Certificate) cert) != null;
|
private void | retirieveEntries()
entriesRetrieved = true;
List rcerts = tbsCertList.getRevokedCertificates();
if (rcerts == null) {
return;
}
entriesSize = rcerts.size();
entries = new ArrayList(entriesSize);
// null means that revoked certificate issuer is the same as CRL issuer
X500Principal rcertIssuer = null;
for (int i=0; i<entriesSize; i++) {
TBSCertList.RevokedCertificate rcert =
(TBSCertList.RevokedCertificate) rcerts.get(i);
X500Principal iss = rcert.getIssuer();
if (iss != null) {
// certificate issuer differs from CRL issuer
// and CRL is indirect.
rcertIssuer = iss;
isIndirectCRL = true;
// remember how many leading revoked certificates in the
// list are issued by the same issuer as issuer of CRL
// (these certificates are first in the list)
nonIndirectEntriesSize = i;
}
entries.add(new X509CRLEntryImpl(rcert, rcertIssuer));
}
|
public java.lang.String | toString()
return crl.toString();
|
public void | verify(java.security.PublicKey key)
Signature signature = Signature.getInstance(getSigAlgName());
signature.initVerify(key);
byte[] tbsEncoding = tbsCertList.getEncoded();
signature.update(tbsEncoding, 0, tbsEncoding.length);
if (!signature.verify(crl.getSignatureValue())) {
throw new SignatureException(Messages.getString("security.15C")); //$NON-NLS-1$
}
|
public void | verify(java.security.PublicKey key, java.lang.String sigProvider)
Signature signature = Signature.getInstance(
getSigAlgName(), sigProvider);
signature.initVerify(key);
byte[] tbsEncoding = tbsCertList.getEncoded();
signature.update(tbsEncoding, 0, tbsEncoding.length);
if (!signature.verify(crl.getSignatureValue())) {
throw new SignatureException(Messages.getString("security.15C")); //$NON-NLS-1$
}
|