< prev index next >
test/java/security/cert/CertificateFactory/BadX509CertData.java
Print this page
rev 1463 : 6535697: keytool can be more flexible on format of PEM-encoded X.509 certificates
Reviewed-by: vinnie
*** 1,7 ****
/*
! * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 38,48 ****
public static void main(String[] args) throws Exception {
CertificateFactory factory = CertificateFactory.getInstance("X.509");
InputStream is = new ByteArrayInputStream(data.getBytes("ISO8859_1"));
try {
Certificate cert = factory.generateCertificate(is);
! } catch (CertificateParsingException ce) {
return;
}
throw new Exception("CertificateFactory.generateCertificate() did "
+ "not throw CertificateParsingException on bad X.509 cert data");
}
--- 38,48 ----
public static void main(String[] args) throws Exception {
CertificateFactory factory = CertificateFactory.getInstance("X.509");
InputStream is = new ByteArrayInputStream(data.getBytes("ISO8859_1"));
try {
Certificate cert = factory.generateCertificate(is);
! } catch (CertificateException ce) {
return;
}
throw new Exception("CertificateFactory.generateCertificate() did "
+ "not throw CertificateParsingException on bad X.509 cert data");
}
< prev index next >