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

org.bouncycastle.est.EnrollmentResponse 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.8 and up. The APIs are designed primarily to be used in conjunction with the BC LTS provider but may also be used with other providers providing cryptographic services.

There is a newer version: 2.73.7
Show newest version
package org.bouncycastle.est;

import org.bouncycastle.asn1.pkcs.PrivateKeyInfo;
import org.bouncycastle.cert.X509CertificateHolder;
import org.bouncycastle.util.Store;


/**
 * Holder class for a response containing the details making up a /simpleenroll response.
 */
public class EnrollmentResponse
{
    private final Store store;
    private final long notBefore;
    private final ESTRequest requestToRetry;
    private final Source source;
    private final PrivateKeyInfo privateKeyInfo;

    public EnrollmentResponse(Store store, long notBefore, ESTRequest requestToRetry, Source session)
    {
        this.store = store;
        this.notBefore = notBefore;
        this.requestToRetry = requestToRetry;
        this.source = session;
        privateKeyInfo = null;
    }


    public EnrollmentResponse(
        Store store,
        long notBefore,
        ESTRequest requestToRetry,
        Source session, PrivateKeyInfo privateKeyInfo)
    {
        this.store = store;
        this.notBefore = notBefore;
        this.requestToRetry = requestToRetry;
        this.source = session;
        this.privateKeyInfo = privateKeyInfo;
    }


    public boolean canRetry()
    {
        return notBefore < System.currentTimeMillis();
    }

    public Store getStore()
    {
        return store;
    }

    public long getNotBefore()
    {
        return notBefore;
    }

    public ESTRequest getRequestToRetry()
    {
        return requestToRetry;
    }

    public Object getSession()
    {
        return source.getSession();
    }

    public Source getSource()
    {
        return source;
    }

    public boolean isCompleted()
    {
        return requestToRetry == null;
    }

    public PrivateKeyInfo getPrivateKeyInfo()
    {
        return privateKeyInfo;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy