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

com.jd.blockchain.ledger.RootCAUpdateOperationBuilderImpl Maven / Gradle / Ivy

There is a newer version: 1.6.5.RELEASE
Show newest version
package com.jd.blockchain.ledger;

import com.jd.blockchain.ca.CertificateUtils;
import com.jd.blockchain.transaction.RootCAUpdateOpTemplate;

import java.security.cert.X509Certificate;

public class RootCAUpdateOperationBuilderImpl implements RootCAUpdateOperationBuilder {

    private RootCAUpdateOpTemplate operation;

    public RootCAUpdateOperationBuilderImpl() {
        this.operation = new RootCAUpdateOpTemplate();
    }

    public RootCAUpdateOperation getOperation() {
        return operation;
    }

    @Override
    public RootCAUpdateOperationBuilder add(String certificate) {
        operation.addCertificate(certificate);
        return this;
    }

    @Override
    public RootCAUpdateOperationBuilder add(X509Certificate certificate) {
        operation.addCertificate(CertificateUtils.toPEMString(certificate));
        return this;
    }

    @Override
    public RootCAUpdateOperationBuilder update(String certificate) {
        operation.updateCertificate(certificate);
        return this;
    }

    @Override
    public RootCAUpdateOperationBuilder update(X509Certificate certificate) {
        operation.updateCertificate(CertificateUtils.toPEMString(certificate));
        return this;
    }

    @Override
    public RootCAUpdateOperationBuilder remove(String certificate) {
        operation.removeCertificate(certificate);
        return this;
    }

    @Override
    public RootCAUpdateOperationBuilder remove(X509Certificate certificate) {
        operation.removeCertificate(CertificateUtils.toPEMString(certificate));
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy