equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
367 + "whitespace after terminating quote"); |
367 + "whitespace after terminating quote"); |
368 } |
368 } |
369 |
369 |
370 // encode as PrintableString unless value contains |
370 // encode as PrintableString unless value contains |
371 // non-PrintableString chars |
371 // non-PrintableString chars |
372 if (this.oid.equals(PKCS9Attribute.EMAIL_ADDRESS_OID) || |
372 if (this.oid.equals((Object)PKCS9Attribute.EMAIL_ADDRESS_OID) || |
373 (this.oid.equals(X500Name.DOMAIN_COMPONENT_OID) && |
373 (this.oid.equals((Object)X500Name.DOMAIN_COMPONENT_OID) && |
374 PRESERVE_OLD_DC_ENCODING == false)) { |
374 PRESERVE_OLD_DC_ENCODING == false)) { |
375 // EmailAddress and DomainComponent must be IA5String |
375 // EmailAddress and DomainComponent must be IA5String |
376 return new DerValue(DerValue.tag_IA5String, |
376 return new DerValue(DerValue.tag_IA5String, |
377 temp.toString().trim()); |
377 temp.toString().trim()); |
378 } else if (isPrintableString) { |
378 } else if (isPrintableString) { |
501 embeddedHex.clear(); |
501 embeddedHex.clear(); |
502 } |
502 } |
503 |
503 |
504 // encode as PrintableString unless value contains |
504 // encode as PrintableString unless value contains |
505 // non-PrintableString chars |
505 // non-PrintableString chars |
506 if (this.oid.equals(PKCS9Attribute.EMAIL_ADDRESS_OID) || |
506 if (this.oid.equals((Object)PKCS9Attribute.EMAIL_ADDRESS_OID) || |
507 (this.oid.equals(X500Name.DOMAIN_COMPONENT_OID) && |
507 (this.oid.equals((Object)X500Name.DOMAIN_COMPONENT_OID) && |
508 PRESERVE_OLD_DC_ENCODING == false)) { |
508 PRESERVE_OLD_DC_ENCODING == false)) { |
509 // EmailAddress and DomainComponent must be IA5String |
509 // EmailAddress and DomainComponent must be IA5String |
510 return new DerValue(DerValue.tag_IA5String, temp.toString()); |
510 return new DerValue(DerValue.tag_IA5String, temp.toString()); |
511 } else if (isPrintableString) { |
511 } else if (isPrintableString) { |
512 return new DerValue(temp.toString()); |
512 return new DerValue(temp.toString()); |