Java 类org.bouncycastle.asn1.eac.CertificationAuthorityReference 实例源码

项目:ipack    文件:EACCertificateBuilder.java   
public EACCertificateBuilder(
    CertificationAuthorityReference certificationAuthorityReference,
    PublicKeyDataObject publicKey,
    CertificateHolderReference certificateHolderReference,
    CertificateHolderAuthorization certificateHolderAuthorization,
    PackedDate certificateEffectiveDate,
    PackedDate certificateExpirationDate)
{
    this.certificationAuthorityReference = certificationAuthorityReference;
    this.publicKey = publicKey;
    this.certificateHolderReference = certificateHolderReference;
    this.certificateHolderAuthorization = certificateHolderAuthorization;
    this.certificateEffectiveDate = certificateEffectiveDate;
    this.certificateExpirationDate = certificateExpirationDate;
}
项目:gwt-crypto    文件:EACCertificateBuilder.java   
public EACCertificateBuilder(
    CertificationAuthorityReference certificationAuthorityReference,
    PublicKeyDataObject publicKey,
    CertificateHolderReference certificateHolderReference,
    CertificateHolderAuthorization certificateHolderAuthorization,
    PackedDate certificateEffectiveDate,
    PackedDate certificateExpirationDate)
{
    this.certificationAuthorityReference = certificationAuthorityReference;
    this.publicKey = publicKey;
    this.certificateHolderReference = certificateHolderReference;
    this.certificateHolderAuthorization = certificateHolderAuthorization;
    this.certificateEffectiveDate = certificateEffectiveDate;
    this.certificateExpirationDate = certificateExpirationDate;
}
项目:Aki-SSL    文件:EACCertificateBuilder.java   
public EACCertificateBuilder(
    CertificationAuthorityReference certificationAuthorityReference,
    PublicKeyDataObject publicKey,
    CertificateHolderReference certificateHolderReference,
    CertificateHolderAuthorization certificateHolderAuthorization,
    PackedDate certificateEffectiveDate,
    PackedDate certificateExpirationDate)
{
    this.certificationAuthorityReference = certificationAuthorityReference;
    this.publicKey = publicKey;
    this.certificateHolderReference = certificateHolderReference;
    this.certificateHolderAuthorization = certificateHolderAuthorization;
    this.certificateEffectiveDate = certificateEffectiveDate;
    this.certificateExpirationDate = certificateExpirationDate;
}
项目:irma_future_id    文件:EACCertificateBuilder.java   
public EACCertificateBuilder(
    CertificationAuthorityReference certificationAuthorityReference,
    PublicKeyDataObject publicKey,
    CertificateHolderReference certificateHolderReference,
    CertificateHolderAuthorization certificateHolderAuthorization,
    PackedDate certificateEffectiveDate,
    PackedDate certificateExpirationDate)
{
    this.certificationAuthorityReference = certificationAuthorityReference;
    this.publicKey = publicKey;
    this.certificateHolderReference = certificateHolderReference;
    this.certificateHolderAuthorization = certificateHolderAuthorization;
    this.certificateEffectiveDate = certificateEffectiveDate;
    this.certificateExpirationDate = certificateExpirationDate;
}
项目:irma_future_id    文件:AllTests.java   
public void testGenerateEC()
    throws Exception
{
    ECParameterSpec ecSpec = ECNamedCurveTable.getParameterSpec("prime256v1");
    KeyPair kp = generateECKeyPair(ecSpec);

    JcaEACSignerBuilder signerBuilder = new JcaEACSignerBuilder().setProvider(BC);

    EACSigner signer = signerBuilder.build("SHA256withECDSA", kp.getPrivate());

    int role = CertificateHolderAuthorization.CVCA;
    int rights = CertificateHolderAuthorization.RADG3 | CertificateHolderAuthorization.RADG4;

    EACCertificateBuilder certBuilder = new EACCertificateBuilder(
        new CertificationAuthorityReference("AU", "BC TEST", "12345"),
        new JcaPublicKeyConverter().getPublicKeyDataObject(signer.getUsageIdentifier(), kp.getPublic()),
        new CertificateHolderReference("AU", "BC TEST", "12345"),
        new CertificateHolderAuthorization(EACObjectIdentifiers.id_EAC_ePassport, role | rights),
        new PackedDate("110101"),
        new PackedDate("120101"));

    EACCertificateHolder certHolder = certBuilder.build(signer);

    EACSignatureVerifier verifier = new JcaEACSignatureVerifierBuilder().build(certHolder.getPublicKeyDataObject().getUsage(), kp.getPublic());

    if (!certHolder.isSignatureValid(verifier))
    {
        fail("first signature test failed");
    }

    PublicKey pubKey = new JcaPublicKeyConverter().setProvider(BC).getKey(certHolder.getPublicKeyDataObject());
    verifier = new JcaEACSignatureVerifierBuilder().build(certHolder.getPublicKeyDataObject().getUsage(), pubKey);

    if (!certHolder.isSignatureValid(verifier))
    {
        fail("first signature test failed");
    }
}
项目:irma_future_id    文件:AllTests.java   
public void testGenerateRSA()
    throws Exception
{
    KeyPair kp = generateRSAKeyPair();

    JcaEACSignerBuilder signerBuilder = new JcaEACSignerBuilder().setProvider(BC);

    EACSigner signer = signerBuilder.build("SHA256withRSA", kp.getPrivate());

    int role = CertificateHolderAuthorization.CVCA;
    int rights = CertificateHolderAuthorization.RADG3 | CertificateHolderAuthorization.RADG4;

    EACCertificateBuilder certBuilder = new EACCertificateBuilder(
        new CertificationAuthorityReference("AU", "BC TEST", "12345"),
        new JcaPublicKeyConverter().getPublicKeyDataObject(signer.getUsageIdentifier(), kp.getPublic()),
        new CertificateHolderReference("AU", "BC TEST", "12345"),
        new CertificateHolderAuthorization(EACObjectIdentifiers.id_EAC_ePassport, role | rights),
        new PackedDate("110101"),
        new PackedDate("120101"));

    EACCertificateHolder certHolder = certBuilder.build(signer);

    EACSignatureVerifier verifier = new JcaEACSignatureVerifierBuilder().build(certHolder.getPublicKeyDataObject().getUsage(), kp.getPublic());

    if (!certHolder.isSignatureValid(verifier))
    {
        fail("first signature test failed");
    }

    PublicKey pubKey = new JcaPublicKeyConverter().setProvider(BC).getKey(certHolder.getPublicKeyDataObject());
    verifier = new JcaEACSignatureVerifierBuilder().build(certHolder.getPublicKeyDataObject().getUsage(), pubKey);

    if (!certHolder.isSignatureValid(verifier))
    {
        fail("first signature test failed");
    }
}
项目:bc-java    文件:EACCertificateBuilder.java   
public EACCertificateBuilder(
    CertificationAuthorityReference certificationAuthorityReference,
    PublicKeyDataObject publicKey,
    CertificateHolderReference certificateHolderReference,
    CertificateHolderAuthorization certificateHolderAuthorization,
    PackedDate certificateEffectiveDate,
    PackedDate certificateExpirationDate)
{
    this.certificationAuthorityReference = certificationAuthorityReference;
    this.publicKey = publicKey;
    this.certificateHolderReference = certificateHolderReference;
    this.certificateHolderAuthorization = certificateHolderAuthorization;
    this.certificateEffectiveDate = certificateEffectiveDate;
    this.certificateExpirationDate = certificateExpirationDate;
}
项目:bc-java    文件:AllTests.java   
public void testGenerateEC()
    throws Exception
{
    ECParameterSpec ecSpec = ECNamedCurveTable.getParameterSpec("prime256v1");
    KeyPair kp = generateECKeyPair(ecSpec);

    JcaEACSignerBuilder signerBuilder = new JcaEACSignerBuilder().setProvider(BC);

    EACSigner signer = signerBuilder.build("SHA256withECDSA", kp.getPrivate());

    int role = CertificateHolderAuthorization.CVCA;
    int rights = CertificateHolderAuthorization.RADG3 | CertificateHolderAuthorization.RADG4;

    EACCertificateBuilder certBuilder = new EACCertificateBuilder(
        new CertificationAuthorityReference("AU", "BC TEST", "12345"),
        new JcaPublicKeyConverter().getPublicKeyDataObject(signer.getUsageIdentifier(), kp.getPublic()),
        new CertificateHolderReference("AU", "BC TEST", "12345"),
        new CertificateHolderAuthorization(EACObjectIdentifiers.id_EAC_ePassport, role | rights),
        new PackedDate("110101"),
        new PackedDate("120101"));

    EACCertificateHolder certHolder = certBuilder.build(signer);

    EACSignatureVerifier verifier = new JcaEACSignatureVerifierBuilder().build(certHolder.getPublicKeyDataObject().getUsage(), kp.getPublic());

    if (!certHolder.isSignatureValid(verifier))
    {
        fail("first signature test failed");
    }

    PublicKey pubKey = new JcaPublicKeyConverter().setProvider(BC).getKey(certHolder.getPublicKeyDataObject());
    verifier = new JcaEACSignatureVerifierBuilder().build(certHolder.getPublicKeyDataObject().getUsage(), pubKey);

    if (!certHolder.isSignatureValid(verifier))
    {
        fail("first signature test failed");
    }
}
项目:bc-java    文件:AllTests.java   
public void testGenerateRSA()
    throws Exception
{
    KeyPair kp = generateRSAKeyPair();

    JcaEACSignerBuilder signerBuilder = new JcaEACSignerBuilder().setProvider(BC);

    EACSigner signer = signerBuilder.build("SHA256withRSA", kp.getPrivate());

    int role = CertificateHolderAuthorization.CVCA;
    int rights = CertificateHolderAuthorization.RADG3 | CertificateHolderAuthorization.RADG4;

    EACCertificateBuilder certBuilder = new EACCertificateBuilder(
        new CertificationAuthorityReference("AU", "BC TEST", "12345"),
        new JcaPublicKeyConverter().getPublicKeyDataObject(signer.getUsageIdentifier(), kp.getPublic()),
        new CertificateHolderReference("AU", "BC TEST", "12345"),
        new CertificateHolderAuthorization(EACObjectIdentifiers.id_EAC_ePassport, role | rights),
        new PackedDate("110101"),
        new PackedDate("120101"));

    EACCertificateHolder certHolder = certBuilder.build(signer);

    EACSignatureVerifier verifier = new JcaEACSignatureVerifierBuilder().build(certHolder.getPublicKeyDataObject().getUsage(), kp.getPublic());

    if (!certHolder.isSignatureValid(verifier))
    {
        fail("first signature test failed");
    }

    PublicKey pubKey = new JcaPublicKeyConverter().setProvider(BC).getKey(certHolder.getPublicKeyDataObject());
    verifier = new JcaEACSignatureVerifierBuilder().build(certHolder.getPublicKeyDataObject().getUsage(), pubKey);

    if (!certHolder.isSignatureValid(verifier))
    {
        fail("first signature test failed");
    }
}