All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bouncycastle.cms.PKIXRecipientId Maven / Gradle / Ivy

Go to download

The Bouncy Castle Java APIs for CMS, PKCS, EAC, TSP, CMP, CRMF, OCSP, and certificate generation. This jar contains APIs for JDK 1.5 to JDK 1.8. The APIs can be used in conjunction with a JCE/JCA provider such as the one provided with the Bouncy Castle Cryptography APIs.

The newest version!
package org.bouncycastle.cms;

import java.math.BigInteger;

import org.bouncycastle.asn1.x500.X500Name;
import org.bouncycastle.cert.selector.X509CertificateHolderSelector;

public class PKIXRecipientId
    extends RecipientId
{
    protected final X509CertificateHolderSelector baseSelector;

    protected PKIXRecipientId(int type, X509CertificateHolderSelector baseSelector)
    {
        super(type);

        this.baseSelector = baseSelector;
    }

    protected PKIXRecipientId(int type, X500Name issuer, BigInteger serialNumber, byte[] subjectKeyId)
    {
        this(type, new X509CertificateHolderSelector(issuer, serialNumber, subjectKeyId));
    }

    public X500Name getIssuer()
    {
        return baseSelector.getIssuer();
    }

    public BigInteger getSerialNumber()
    {
        return baseSelector.getSerialNumber();
    }

    public byte[] getSubjectKeyIdentifier()
    {
        return baseSelector.getSubjectKeyIdentifier();
    }

    public Object clone()
    {
        return new PKIXRecipientId(getType(), baseSelector);
    }

    public int hashCode()
    {
        return baseSelector.hashCode();
    }

    public boolean equals(
        Object  o)
    {
        if (!(o instanceof PKIXRecipientId))
        {
            return false;
        }

        PKIXRecipientId id = (PKIXRecipientId)o;

        return this.baseSelector.equals(id.baseSelector);
    }

    public boolean match(Object obj)
    {
        return baseSelector.match(obj);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy