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

org.bouncycastle.asn1.cmc.CMCStatusInfoV2Builder Maven / Gradle / Ivy

Go to download

The Bouncy Castle Java APIs for ASN.1 extension and utility APIs used to support bcpkix and bctls with the BC FIPS provider. The APIs may also be used with other providers although if being used in a FIPS context it is the responsibility of the user to ensure that any other providers used are FIPS certified and used appropriately.

There is a newer version: 2.0.3
Show newest version
package org.bouncycastle.asn1.cmc;

import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.asn1.DERUTF8String;

public class CMCStatusInfoV2Builder
{
    private final CMCStatus cMCStatus;
    private final ASN1Sequence bodyList;

    private DERUTF8String statusString;
    private OtherStatusInfo otherInfo;

    public CMCStatusInfoV2Builder(CMCStatus cMCStatus, BodyPartID bodyPartID)
    {
        this.cMCStatus = cMCStatus;
        this.bodyList = new DERSequence(bodyPartID);
    }

    public CMCStatusInfoV2Builder(CMCStatus cMCStatus, BodyPartID[] bodyList)
    {
        this.cMCStatus = cMCStatus;
        this.bodyList = new DERSequence(bodyList);
    }

    public CMCStatusInfoV2Builder setStatusString(String statusString)
    {
        this.statusString = new DERUTF8String(statusString);

        return this;
    }

    public CMCStatusInfoV2Builder setOtherInfo(CMCFailInfo failInfo)
    {
        this.otherInfo = new OtherStatusInfo(failInfo);

        return this;
    }

    public CMCStatusInfoV2Builder setOtherInfo(ExtendedFailInfo extendedFailInfo)
    {
        this.otherInfo = new OtherStatusInfo(extendedFailInfo);

        return this;
    }

    public CMCStatusInfoV2Builder setOtherInfo(PendInfo pendInfo)
    {
        this.otherInfo = new OtherStatusInfo(pendInfo);

        return this;
    }

    public CMCStatusInfoV2 build()
    {
        return new CMCStatusInfoV2(cMCStatus, bodyList, statusString, otherInfo);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy