Code example for X509CertSelector

Methods: getIssuerAsBytesgetSerialNumbergetSubjectKeyIdentifier

0
 
    public SignerId getSignerId(X509CertSelector certSelector)
    { 
        try 
        { 
            if (certSelector.getSubjectKeyIdentifier() != null)
            { 
                return new SignerId(X500Name.getInstance(certSelector.getIssuerAsBytes()), certSelector.getSerialNumber(), ASN1OctetString.getInstance(certSelector.getSubjectKeyIdentifier()).getOctets());
            } 
            else 
            { 
                return new SignerId(X500Name.getInstance(certSelector.getIssuerAsBytes()), certSelector.getSerialNumber());
            } 
        } 
        catch (IOException e)
        { 
            throw new IllegalArgumentException("unable to convert issuer: " + e.getMessage());
        } 
    }