Commit 3c2819fb authored by Tobias Assmann's avatar Tobias Assmann
Browse files

set testdata for csr creation if session filling with data has been failed....

set testdata for csr creation if session filling with data has been failed. THIS IS ONLY A TMP HACK AND NOT PROD READY!!!
parent 4616271f
......@@ -90,11 +90,26 @@ public class CSRFactory {
x500NameBld.addRDN(BCStyle.CN, new DERPrintableString(caIssuerName));
X500Name issuerDN = x500NameBld.build();
x500NameBld = new X500NameBuilder(BCStyle.INSTANCE);
//TODO: if card comes with data like foreign names, seems like parsing and setting
//users data in session fails, this should be fixed. As a quickhack we hardcode testdata here.
if (givenname==null) {
givenname="Max";
}
if (surname==null) {
surname="Mustermann";
}
x500NameBld.addRDN(BCStyle.CN, new DERPrintableString(givenname + " " + surname));
x500NameBld.addRDN(BCStyle.GIVENNAME, new DERPrintableString(givenname));
x500NameBld.addRDN(BCStyle.SURNAME, new DERPrintableString(surname));
if (birthname==null) {
birthname="Mustermann";
}
x500NameBld.addRDN(BCStyle.NAME_AT_BIRTH, new DERPrintableString(birthname));
x500NameBld.addRDN(BCStyle.DATE_OF_BIRTH, new Time(dateOfBirth));
if (dateOfBirth!=null) {
x500NameBld.addRDN(BCStyle.DATE_OF_BIRTH, new Time(dateOfBirth));
} else {
x500NameBld.addRDN(BCStyle.DATE_OF_BIRTH, new Time(new Date(100, 01, 01, 00, 00, 00)));
}
X500Name subjectDN = x500NameBld.build();
GeneralName recipient = new GeneralName(issuerDN);
GeneralName sender = new GeneralName(subjectDN);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment