diff options
Diffstat (limited to 'bcprov/src/main/java/org/bouncycastle/asn1/eac')
8 files changed, 30 insertions, 14 deletions
diff --git a/bcprov/src/main/java/org/bouncycastle/asn1/eac/CVCertificate.java b/bcprov/src/main/java/org/bouncycastle/asn1/eac/CVCertificate.java index 845925c..7bbd7f1 100644 --- a/bcprov/src/main/java/org/bouncycastle/asn1/eac/CVCertificate.java +++ b/bcprov/src/main/java/org/bouncycastle/asn1/eac/CVCertificate.java @@ -15,7 +15,6 @@ import org.bouncycastle.asn1.DEROctetString; /** * an iso7816Certificate structure. - * <p/> * <pre> * Certificate ::= SEQUENCE { * CertificateBody Iso7816CertificateBody, @@ -85,7 +84,6 @@ public class CVCertificate * Create an iso7816Certificate structure from an ASN1InputStream. * * @param aIS the byte stream to parse. - * @return the Iso7816CertificateStructure represented by the byte stream. * @throws IOException if there is a problem parsing the data. */ public CVCertificate(ASN1InputStream aIS) @@ -129,7 +127,6 @@ public class CVCertificate * * @param body the Iso7816CertificateBody object containing the body. * @param signature the byte array containing the signature - * @return the Iso7816CertificateStructure * @throws IOException if there is a problem parsing the data. */ public CVCertificate(CertificateBody body, byte[] signature) @@ -147,7 +144,6 @@ public class CVCertificate * * @param obj the Object to extract the certificate from. * @return the Iso7816CertificateStructure represented by the byte stream. - * @throws IOException if there is a problem parsing the data. */ public static CVCertificate getInstance(Object obj) { diff --git a/bcprov/src/main/java/org/bouncycastle/asn1/eac/CertificateBody.java b/bcprov/src/main/java/org/bouncycastle/asn1/eac/CertificateBody.java index 87d6554..04c4d70 100644 --- a/bcprov/src/main/java/org/bouncycastle/asn1/eac/CertificateBody.java +++ b/bcprov/src/main/java/org/bouncycastle/asn1/eac/CertificateBody.java @@ -13,7 +13,6 @@ import org.bouncycastle.asn1.DEROctetString; /** * an Iso7816CertificateBody structure. - * <p/> * <pre> * CertificateBody ::= SEQUENCE { * // version of the certificate format. Must be 0 (version 1) @@ -128,7 +127,6 @@ public class CertificateBody * @param certificateHolderAuthorization * @param certificateEffectiveDate * @param certificateExpirationDate - * @throws IOException */ public CertificateBody( DERApplicationSpecific certificateProfileIdentifier, @@ -276,7 +274,6 @@ public class CertificateBody * create a "request" or "profile" type Iso7816CertificateBody according to the variables sets. * * @return return the ASN1Primitive representing the "request" or "profile" type certificate body. - * @throws IOException if the DERApplicationSpecific cannot be created or if data are missings to create a valid certificate. */ public ASN1Primitive toASN1Primitive() { diff --git a/bcprov/src/main/java/org/bouncycastle/asn1/eac/CertificateHolderAuthorization.java b/bcprov/src/main/java/org/bouncycastle/asn1/eac/CertificateHolderAuthorization.java index 93ae57f..ba8486a 100644 --- a/bcprov/src/main/java/org/bouncycastle/asn1/eac/CertificateHolderAuthorization.java +++ b/bcprov/src/main/java/org/bouncycastle/asn1/eac/CertificateHolderAuthorization.java @@ -13,7 +13,6 @@ import org.bouncycastle.util.Integers; /** * an Iso7816CertificateHolderAuthorization structure. - * <p/> * <pre> * Certificate Holder Authorization ::= SEQUENCE { * // specifies the format and the rules for the evaluation of the authorization diff --git a/bcprov/src/main/java/org/bouncycastle/asn1/eac/EACObjectIdentifiers.java b/bcprov/src/main/java/org/bouncycastle/asn1/eac/EACObjectIdentifiers.java index 77416dc..805a506 100644 --- a/bcprov/src/main/java/org/bouncycastle/asn1/eac/EACObjectIdentifiers.java +++ b/bcprov/src/main/java/org/bouncycastle/asn1/eac/EACObjectIdentifiers.java @@ -4,17 +4,17 @@ import org.bouncycastle.asn1.ASN1ObjectIdentifier; /** * German Federal Office for Information Security - * (Bundesamt für Sicherheit in der Informationstechnik) + * (Bundesamt für Sicherheit in der Informationstechnik) * <a href="http://www.bsi.bund.de/">http://www.bsi.bund.de/</a> * <p> * <a href="https://www.bsi.bund.de/EN/Publications/TechnicalGuidelines/TR03110/BSITR03110.html">BSI TR-03110</a> * Technical Guideline Advanced Security Mechanisms for Machine Readable Travel Documents * <p> - * <a href="https://www.bsi.bund.de/SharedDocs/Downloads/EN/BSI/Publications/TechGuidelines/TR03110/TR-03110_v2.1_P3pdf.pdf?__blob=publicationFile">Technical Guideline TR-03110-3</a> + * <a href="https://www.bsi.bund.de/SharedDocs/Downloads/EN/BSI/Publications/TechGuidelines/TR03110/TR-03110_v2.1_P3pdf.pdf"> + * Technical Guideline TR-03110-3</a> * Advanced Security Mechanisms for Machine Readable Travel Documents; * Part 3: Common Specifications. */ - public interface EACObjectIdentifiers { /** diff --git a/bcprov/src/main/java/org/bouncycastle/asn1/eac/ECDSAPublicKey.java b/bcprov/src/main/java/org/bouncycastle/asn1/eac/ECDSAPublicKey.java index 3dd22fc..077807f 100644 --- a/bcprov/src/main/java/org/bouncycastle/asn1/eac/ECDSAPublicKey.java +++ b/bcprov/src/main/java/org/bouncycastle/asn1/eac/ECDSAPublicKey.java @@ -15,7 +15,6 @@ import org.bouncycastle.asn1.DERTaggedObject; /** * an Iso7816ECDSAPublicKeyStructure structure. - * <p/> * <pre> * Certificate Holder Authorization ::= SEQUENCE { * ASN1TaggedObject primeModulusP; // OPTIONAL diff --git a/bcprov/src/main/java/org/bouncycastle/asn1/eac/PackedDate.java b/bcprov/src/main/java/org/bouncycastle/asn1/eac/PackedDate.java index 29b0881..e19c96f 100644 --- a/bcprov/src/main/java/org/bouncycastle/asn1/eac/PackedDate.java +++ b/bcprov/src/main/java/org/bouncycastle/asn1/eac/PackedDate.java @@ -3,6 +3,7 @@ package org.bouncycastle.asn1.eac; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.Locale; import java.util.SimpleTimeZone; import org.bouncycastle.util.Arrays; @@ -21,7 +22,9 @@ public class PackedDate } /** - * base constructer from a java.util.date object + * Base constructor from a java.util.date object. + * + * @param time a date object representing the time of interest. */ public PackedDate( Date time) @@ -33,6 +36,24 @@ public class PackedDate this.time = convert(dateF.format(time)); } + /** + * Base constructor from a java.util.date object. You may need to use this constructor if the default locale + * doesn't use a Gregorian calender so that the PackedDate produced is compatible with other ASN.1 implementations. + * + * @param time a date object representing the time of interest. + * @param locale an appropriate Locale for producing an ASN.1 GeneralizedTime value. + */ + public PackedDate( + Date time, + Locale locale) + { + SimpleDateFormat dateF = new SimpleDateFormat("yyMMdd'Z'", locale); + + dateF.setTimeZone(new SimpleTimeZone(0,"Z")); + + this.time = convert(dateF.format(time)); + } + private byte[] convert(String sTime) { char[] digs = sTime.toCharArray(); diff --git a/bcprov/src/main/java/org/bouncycastle/asn1/eac/RSAPublicKey.java b/bcprov/src/main/java/org/bouncycastle/asn1/eac/RSAPublicKey.java index 7c85169..3e1727e 100644 --- a/bcprov/src/main/java/org/bouncycastle/asn1/eac/RSAPublicKey.java +++ b/bcprov/src/main/java/org/bouncycastle/asn1/eac/RSAPublicKey.java @@ -12,7 +12,6 @@ import org.bouncycastle.asn1.DERSequence; /** * an Iso7816RSAPublicKeyStructure structure. - * <p/> * <pre> * Certificate Holder Authorization ::= SEQUENCE { * // modulus should be at least 1024bit and a multiple of 512. diff --git a/bcprov/src/main/java/org/bouncycastle/asn1/eac/package.html b/bcprov/src/main/java/org/bouncycastle/asn1/eac/package.html new file mode 100644 index 0000000..360d598 --- /dev/null +++ b/bcprov/src/main/java/org/bouncycastle/asn1/eac/package.html @@ -0,0 +1,5 @@ +<html> +<body bgcolor="#ffffff"> +ASN.1 classes specific to the Bundesamt für Sicherheit in der Informationstechnik (BSI) Technical Guideline Advanced Security Mechanisms for Machine Readable Travel Documents. +</body> +</html> |