Code example for X509CertSelector

Methods: getIssuerAsBytesgetSerialNumbergetSubjectKeyIdentifier

0
 
    public X509CertificateHolderSelector getCertificateHolderSelector(X509CertSelector certSelector)
    { 
try 
{ 
        if (certSelector.getSubjectKeyIdentifier() != null)
        { 
            return new X509CertificateHolderSelector(X500Name.getInstance(certSelector.getIssuerAsBytes()), certSelector.getSerialNumber(), ASN1OctetString.getInstance(certSelector.getSubjectKeyIdentifier()).getOctets());
        } 
        else 
        { 
            return new X509CertificateHolderSelector(X500Name.getInstance(certSelector.getIssuerAsBytes()), certSelector.getSerialNumber());
        } 
} 
catch (Exception e)
{ 
throw new IllegalArgumentException("conversion failed: " + e.toString());
} 
    } 
}