diff options
author | Sergio Giro <sgiro@google.com> | 2015-12-11 18:58:58 +0000 |
---|---|---|
committer | Sergio Giro <sgiro@google.com> | 2016-01-25 15:38:49 +0000 |
commit | 16f9ee464b68937f45d009d9c1b0eb9b544a8dee (patch) | |
tree | 61086f6673133c387b13b0e494e42973c6f4c0e8 /bcpkix/src/main/java/org/bouncycastle/pkcs/bc/BcPKCS10CertificationRequest.java | |
parent | fcfe48e7cf461bf4a6314802c0f31f292d87ab95 (diff) | |
download | bouncycastle-16f9ee464b68937f45d009d9c1b0eb9b544a8dee.tar.gz |
bouncycastle: Android tree with upstream code for version 1.49
Android tree as of 08e455bd61ddaa02255383e85480b0d9cde6e954
Change-Id: I99dab80b49707f0fdefb67ccd1bcfe765363b5e5
Diffstat (limited to 'bcpkix/src/main/java/org/bouncycastle/pkcs/bc/BcPKCS10CertificationRequest.java')
-rw-r--r-- | bcpkix/src/main/java/org/bouncycastle/pkcs/bc/BcPKCS10CertificationRequest.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/bcpkix/src/main/java/org/bouncycastle/pkcs/bc/BcPKCS10CertificationRequest.java b/bcpkix/src/main/java/org/bouncycastle/pkcs/bc/BcPKCS10CertificationRequest.java new file mode 100644 index 00000000..99c337c9 --- /dev/null +++ b/bcpkix/src/main/java/org/bouncycastle/pkcs/bc/BcPKCS10CertificationRequest.java @@ -0,0 +1,42 @@ +package org.bouncycastle.pkcs.bc; + +import java.io.IOException; + +import org.bouncycastle.asn1.pkcs.CertificationRequest; +import org.bouncycastle.crypto.params.AsymmetricKeyParameter; +import org.bouncycastle.crypto.util.PublicKeyFactory; +import org.bouncycastle.pkcs.PKCS10CertificationRequest; +import org.bouncycastle.pkcs.PKCSException; + +public class BcPKCS10CertificationRequest + extends PKCS10CertificationRequest +{ + public BcPKCS10CertificationRequest(CertificationRequest certificationRequest) + { + super(certificationRequest); + } + + public BcPKCS10CertificationRequest(byte[] encoding) + throws IOException + { + super(encoding); + } + + public BcPKCS10CertificationRequest(PKCS10CertificationRequest requestHolder) + { + super(requestHolder.toASN1Structure()); + } + + public AsymmetricKeyParameter getPublicKey() + throws PKCSException + { + try + { + return PublicKeyFactory.createKey(this.getSubjectPublicKeyInfo()); + } + catch (IOException e) + { + throw new PKCSException("error extracting key encoding: " + e.getMessage(), e); + } + } +} |