1. /*
  2. * @(#)X509Certificate.java 1.39 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.security.cert;
  8. import java.math.BigInteger;
  9. import java.security.Principal;
  10. import java.security.PublicKey;
  11. import java.util.Collection;
  12. import java.util.Date;
  13. import java.util.List;
  14. import javax.security.auth.x500.X500Principal;
  15. import sun.security.x509.X509CertImpl;
  16. /**
  17. * <p>
  18. * Abstract class for X.509 certificates. This provides a standard
  19. * way to access all the attributes of an X.509 certificate.
  20. * <p>
  21. * In June of 1996, the basic X.509 v3 format was completed by
  22. * ISO/IEC and ANSI X9, which is described below in ASN.1:
  23. * <pre>
  24. * Certificate ::= SEQUENCE {
  25. * tbsCertificate TBSCertificate,
  26. * signatureAlgorithm AlgorithmIdentifier,
  27. * signature BIT STRING }
  28. * </pre>
  29. * <p>
  30. * These certificates are widely used to support authentication and
  31. * other functionality in Internet security systems. Common applications
  32. * include Privacy Enhanced Mail (PEM), Transport Layer Security (SSL),
  33. * code signing for trusted software distribution, and Secure Electronic
  34. * Transactions (SET).
  35. * <p>
  36. * These certificates are managed and vouched for by <em>Certificate
  37. * Authorities</em> (CAs). CAs are services which create certificates by
  38. * placing data in the X.509 standard format and then digitally signing
  39. * that data. CAs act as trusted third parties, making introductions
  40. * between principals who have no direct knowledge of each other.
  41. * CA certificates are either signed by themselves, or by some other
  42. * CA such as a "root" CA.
  43. * <p>
  44. * More information can be found in RFC 2459,
  45. * "Internet X.509 Public Key Infrastructure Certificate and CRL
  46. * Profile" at <A HREF="http://www.ietf.org/rfc/rfc2459.txt">
  47. * http://www.ietf.org/rfc/rfc2459.txt </A>.
  48. * <p>
  49. * The ASN.1 definition of <code>tbsCertificate</code> is:
  50. * <pre>
  51. * TBSCertificate ::= SEQUENCE {
  52. * version [0] EXPLICIT Version DEFAULT v1,
  53. * serialNumber CertificateSerialNumber,
  54. * signature AlgorithmIdentifier,
  55. * issuer Name,
  56. * validity Validity,
  57. * subject Name,
  58. * subjectPublicKeyInfo SubjectPublicKeyInfo,
  59. * issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,
  60. * -- If present, version must be v2 or v3
  61. * subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL,
  62. * -- If present, version must be v2 or v3
  63. * extensions [3] EXPLICIT Extensions OPTIONAL
  64. * -- If present, version must be v3
  65. * }
  66. * </pre>
  67. * <p>
  68. * Certificates are instantiated using a certificate factory. The following is
  69. * an example of how to instantiate an X.509 certificate:
  70. * <pre>
  71. * InputStream inStream = new FileInputStream("fileName-of-cert");
  72. * CertificateFactory cf = CertificateFactory.getInstance("X.509");
  73. * X509Certificate cert = (X509Certificate)cf.generateCertificate(inStream);
  74. * inStream.close();
  75. * </pre>
  76. *
  77. * @author Hemma Prafullchandra
  78. *
  79. * @version 1.39
  80. *
  81. * @see Certificate
  82. * @see CertificateFactory
  83. * @see X509Extension
  84. */
  85. public abstract class X509Certificate extends Certificate
  86. implements X509Extension {
  87. private static final long serialVersionUID = -2491127588187038216L;
  88. private transient X500Principal subjectX500Principal, issuerX500Principal;
  89. /**
  90. * Constructor for X.509 certificates.
  91. */
  92. protected X509Certificate() {
  93. super("X.509");
  94. }
  95. /**
  96. * Checks that the certificate is currently valid. It is if
  97. * the current date and time are within the validity period given in the
  98. * certificate.
  99. * <p>
  100. * The validity period consists of two date/time values:
  101. * the first and last dates (and times) on which the certificate
  102. * is valid. It is defined in
  103. * ASN.1 as:
  104. * <pre>
  105. * validity Validity<p>
  106. * Validity ::= SEQUENCE {
  107. * notBefore CertificateValidityDate,
  108. * notAfter CertificateValidityDate }<p>
  109. * CertificateValidityDate ::= CHOICE {
  110. * utcTime UTCTime,
  111. * generalTime GeneralizedTime }
  112. * </pre>
  113. *
  114. * @exception CertificateExpiredException if the certificate has expired.
  115. * @exception CertificateNotYetValidException if the certificate is not
  116. * yet valid.
  117. */
  118. public abstract void checkValidity()
  119. throws CertificateExpiredException, CertificateNotYetValidException;
  120. /**
  121. * Checks that the given date is within the certificate's
  122. * validity period. In other words, this determines whether the
  123. * certificate would be valid at the given date/time.
  124. *
  125. * @param date the Date to check against to see if this certificate
  126. * is valid at that date/time.
  127. *
  128. * @exception CertificateExpiredException if the certificate has expired
  129. * with respect to the <code>date</code> supplied.
  130. * @exception CertificateNotYetValidException if the certificate is not
  131. * yet valid with respect to the <code>date</code> supplied.
  132. *
  133. * @see #checkValidity()
  134. */
  135. public abstract void checkValidity(Date date)
  136. throws CertificateExpiredException, CertificateNotYetValidException;
  137. /**
  138. * Gets the <code>version</code> (version number) value from the
  139. * certificate.
  140. * The ASN.1 definition for this is:
  141. * <pre>
  142. * version [0] EXPLICIT Version DEFAULT v1<p>
  143. * Version ::= INTEGER { v1(0), v2(1), v3(2) }
  144. * </pre>
  145. * @return the version number, i.e. 1, 2 or 3.
  146. */
  147. public abstract int getVersion();
  148. /**
  149. * Gets the <code>serialNumber</code> value from the certificate.
  150. * The serial number is an integer assigned by the certification
  151. * authority to each certificate. It must be unique for each
  152. * certificate issued by a given CA (i.e., the issuer name and
  153. * serial number identify a unique certificate).
  154. * The ASN.1 definition for this is:
  155. * <pre>
  156. * serialNumber CertificateSerialNumber<p>
  157. *
  158. * CertificateSerialNumber ::= INTEGER
  159. * </pre>
  160. *
  161. * @return the serial number.
  162. */
  163. public abstract BigInteger getSerialNumber();
  164. /**
  165. * <strong>Denigrated</strong>, replaced by {@linkplain
  166. * #getIssuerX500Principal()}. This method returns the <code>issuer</code>
  167. * as an implementation specific Principal object, which should not be
  168. * relied upon by portable code.
  169. *
  170. * <p>
  171. * Gets the <code>issuer</code> (issuer distinguished name) value from
  172. * the certificate. The issuer name identifies the entity that signed (and
  173. * issued) the certificate.
  174. *
  175. * <p>The issuer name field contains an
  176. * X.500 distinguished name (DN).
  177. * The ASN.1 definition for this is:
  178. * <pre>
  179. * issuer Name<p>
  180. *
  181. * Name ::= CHOICE { RDNSequence }
  182. * RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
  183. * RelativeDistinguishedName ::=
  184. * SET OF AttributeValueAssertion
  185. *
  186. * AttributeValueAssertion ::= SEQUENCE {
  187. * AttributeType,
  188. * AttributeValue }
  189. * AttributeType ::= OBJECT IDENTIFIER
  190. * AttributeValue ::= ANY
  191. * </pre>
  192. * The <code>Name</code> describes a hierarchical name composed of
  193. * attributes,
  194. * such as country name, and corresponding values, such as US.
  195. * The type of the <code>AttributeValue</code> component is determined by
  196. * the <code>AttributeType</code> in general it will be a
  197. * <code>directoryString</code>. A <code>directoryString</code> is usually
  198. * one of <code>PrintableString</code>,
  199. * <code>TeletexString</code> or <code>UniversalString</code>.
  200. *
  201. * @return a Principal whose name is the issuer distinguished name.
  202. */
  203. public abstract Principal getIssuerDN();
  204. /**
  205. * Returns the issuer (issuer distinguished name) value from the
  206. * certificate as an <code>X500Principal</code>.
  207. * <p>
  208. * It is recommended that subclasses override this method.
  209. *
  210. * @return an <code>X500Principal</code> representing the issuer
  211. * distinguished name
  212. * @since 1.4
  213. */
  214. public X500Principal getIssuerX500Principal() {
  215. if (issuerX500Principal == null) {
  216. issuerX500Principal = X509CertImpl.getIssuerX500Principal(this);
  217. }
  218. return issuerX500Principal;
  219. }
  220. /**
  221. * <strong>Denigrated</strong>, replaced by {@linkplain
  222. * #getSubjectX500Principal()}. This method returns the <code>subject</code>
  223. * as an implementation specific Principal object, which should not be
  224. * relied upon by portable code.
  225. *
  226. * <p>
  227. * Gets the <code>subject</code> (subject distinguished name) value
  228. * from the certificate. If the <code>subject</code> value is empty,
  229. * then the <code>getName()</code> method of the returned
  230. * <code>Principal</code> object returns an empty string ("").
  231. *
  232. * <p> The ASN.1 definition for this is:
  233. * <pre>
  234. * subject Name
  235. * </pre>
  236. *
  237. * <p>See {@link #getIssuerDN() getIssuerDN} for <code>Name</code>
  238. * and other relevant definitions.
  239. *
  240. * @return a Principal whose name is the subject name.
  241. */
  242. public abstract Principal getSubjectDN();
  243. /**
  244. * Returns the subject (subject distinguished name) value from the
  245. * certificate as an <code>X500Principal</code>. If the subject value
  246. * is empty, then the <code>getName()</code> method of the returned
  247. * <code>X500Principal</code> object returns an empty string ("").
  248. * <p>
  249. * It is recommended that subclasses override this method.
  250. *
  251. * @return an <code>X500Principal</code> representing the subject
  252. * distinguished name
  253. * @since 1.4
  254. */
  255. public X500Principal getSubjectX500Principal() {
  256. if (subjectX500Principal == null) {
  257. subjectX500Principal = X509CertImpl.getSubjectX500Principal(this);
  258. }
  259. return subjectX500Principal;
  260. }
  261. /**
  262. * Gets the <code>notBefore</code> date from the validity period of
  263. * the certificate.
  264. * The relevant ASN.1 definitions are:
  265. * <pre>
  266. * validity Validity<p>
  267. *
  268. * Validity ::= SEQUENCE {
  269. * notBefore CertificateValidityDate,
  270. * notAfter CertificateValidityDate }<p>
  271. * CertificateValidityDate ::= CHOICE {
  272. * utcTime UTCTime,
  273. * generalTime GeneralizedTime }
  274. * </pre>
  275. *
  276. * @return the start date of the validity period.
  277. * @see #checkValidity
  278. */
  279. public abstract Date getNotBefore();
  280. /**
  281. * Gets the <code>notAfter</code> date from the validity period of
  282. * the certificate. See {@link #getNotBefore() getNotBefore}
  283. * for relevant ASN.1 definitions.
  284. *
  285. * @return the end date of the validity period.
  286. * @see #checkValidity
  287. */
  288. public abstract Date getNotAfter();
  289. /**
  290. * Gets the DER-encoded certificate information, the
  291. * <code>tbsCertificate</code> from this certificate.
  292. * This can be used to verify the signature independently.
  293. *
  294. * @return the DER-encoded certificate information.
  295. * @exception CertificateEncodingException if an encoding error occurs.
  296. */
  297. public abstract byte[] getTBSCertificate()
  298. throws CertificateEncodingException;
  299. /**
  300. * Gets the <code>signature</code> value (the raw signature bits) from
  301. * the certificate.
  302. * The ASN.1 definition for this is:
  303. * <pre>
  304. * signature BIT STRING
  305. * </pre>
  306. *
  307. * @return the signature.
  308. */
  309. public abstract byte[] getSignature();
  310. /**
  311. * Gets the signature algorithm name for the certificate
  312. * signature algorithm. An example is the string "SHA-1/DSA".
  313. * The ASN.1 definition for this is:
  314. * <pre>
  315. * signatureAlgorithm AlgorithmIdentifier<p>
  316. * AlgorithmIdentifier ::= SEQUENCE {
  317. * algorithm OBJECT IDENTIFIER,
  318. * parameters ANY DEFINED BY algorithm OPTIONAL }
  319. * -- contains a value of the type
  320. * -- registered for use with the
  321. * -- algorithm object identifier value
  322. * </pre>
  323. *
  324. * <p>The algorithm name is determined from the <code>algorithm</code>
  325. * OID string.
  326. *
  327. * @return the signature algorithm name.
  328. */
  329. public abstract String getSigAlgName();
  330. /**
  331. * Gets the signature algorithm OID string from the certificate.
  332. * An OID is represented by a set of nonnegative whole numbers separated
  333. * by periods.
  334. * For example, the string "1.2.840.10040.4.3" identifies the SHA-1
  335. * with DSA signature algorithm, as per RFC 2459.
  336. *
  337. * <p>See {@link #getSigAlgName() getSigAlgName} for
  338. * relevant ASN.1 definitions.
  339. *
  340. * @return the signature algorithm OID string.
  341. */
  342. public abstract String getSigAlgOID();
  343. /**
  344. * Gets the DER-encoded signature algorithm parameters from this
  345. * certificate's signature algorithm. In most cases, the signature
  346. * algorithm parameters are null; the parameters are usually
  347. * supplied with the certificate's public key.
  348. * If access to individual parameter values is needed then use
  349. * {@link java.security.AlgorithmParameters AlgorithmParameters}
  350. * and instantiate with the name returned by
  351. * {@link #getSigAlgName() getSigAlgName}.
  352. *
  353. * <p>See {@link #getSigAlgName() getSigAlgName} for
  354. * relevant ASN.1 definitions.
  355. *
  356. * @return the DER-encoded signature algorithm parameters, or
  357. * null if no parameters are present.
  358. */
  359. public abstract byte[] getSigAlgParams();
  360. /**
  361. * Gets the <code>issuerUniqueID</code> value from the certificate.
  362. * The issuer unique identifier is present in the certificate
  363. * to handle the possibility of reuse of issuer names over time.
  364. * RFC 2459 recommends that names not be reused and that
  365. * conforming certificates not make use of unique identifiers.
  366. * Applications conforming to that profile should be capable of
  367. * parsing unique identifiers and making comparisons.
  368. *
  369. * <p>The ASN.1 definition for this is:
  370. * <pre>
  371. * issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL<p>
  372. * UniqueIdentifier ::= BIT STRING
  373. * </pre>
  374. *
  375. * @return the issuer unique identifier or null if it is not
  376. * present in the certificate.
  377. */
  378. public abstract boolean[] getIssuerUniqueID();
  379. /**
  380. * Gets the <code>subjectUniqueID</code> value from the certificate.
  381. *
  382. * <p>The ASN.1 definition for this is:
  383. * <pre>
  384. * subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL<p>
  385. * UniqueIdentifier ::= BIT STRING
  386. * </pre>
  387. *
  388. * @return the subject unique identifier or null if it is not
  389. * present in the certificate.
  390. */
  391. public abstract boolean[] getSubjectUniqueID();
  392. /**
  393. * Gets a boolean array representing bits of
  394. * the <code>KeyUsage</code> extension, (OID = 2.5.29.15).
  395. * The key usage extension defines the purpose (e.g., encipherment,
  396. * signature, certificate signing) of the key contained in the
  397. * certificate.
  398. * The ASN.1 definition for this is:
  399. * <pre>
  400. * KeyUsage ::= BIT STRING {
  401. * digitalSignature (0),
  402. * nonRepudiation (1),
  403. * keyEncipherment (2),
  404. * dataEncipherment (3),
  405. * keyAgreement (4),
  406. * keyCertSign (5),
  407. * cRLSign (6),
  408. * encipherOnly (7),
  409. * decipherOnly (8) }
  410. * </pre>
  411. * RFC 2459 recommends that when used, this be marked
  412. * as a critical extension.
  413. *
  414. * @return the KeyUsage extension of this certificate, represented as
  415. * an array of booleans. The order of KeyUsage values in the array is
  416. * the same as in the above ASN.1 definition. The array will contain a
  417. * value for each KeyUsage defined above. If the KeyUsage list encoded
  418. * in the certificate is longer than the above list, it will not be
  419. * truncated. Returns null if this certificate does not
  420. * contain a KeyUsage extension.
  421. */
  422. public abstract boolean[] getKeyUsage();
  423. /**
  424. * Gets an unmodifiable list of Strings representing the OBJECT
  425. * IDENTIFIERs of the <code>ExtKeyUsageSyntax</code> field of the
  426. * extended key usage extension, (OID = 2.5.29.37). It indicates
  427. * one or more purposes for which the certified public key may be
  428. * used, in addition to or in place of the basic purposes
  429. * indicated in the key usage extension field. The ASN.1
  430. * definition for this is:
  431. * <pre>
  432. * ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId<p>
  433. *
  434. * KeyPurposeId ::= OBJECT IDENTIFIER<p>
  435. * </pre>
  436. *
  437. * Key purposes may be defined by any organization with a
  438. * need. Object identifiers used to identify key purposes shall be
  439. * assigned in accordance with IANA or ITU-T Rec. X.660 |
  440. * ISO/IEC/ITU 9834-1.
  441. * <p>
  442. * This method was added to version 1.4 of the Java 2 Platform Standard
  443. * Edition. In order to maintain backwards compatibility with existing
  444. * service providers, this method is not <code>abstract</code>
  445. * and it provides a default implementation. Subclasses
  446. * should override this method with a correct implementation.
  447. *
  448. * @return the ExtendedKeyUsage extension of this certificate,
  449. * as an unmodifiable list of object identifiers represented
  450. * as Strings. Returns null if this certificate does not
  451. * contain an ExtendedKeyUsage extension.
  452. * @throws CertificateParsingException if the extension cannot be decoded
  453. * @since 1.4
  454. */
  455. public List<String> getExtendedKeyUsage() throws CertificateParsingException {
  456. return X509CertImpl.getExtendedKeyUsage(this);
  457. }
  458. /**
  459. * Gets the certificate constraints path length from the
  460. * critical <code>BasicConstraints</code> extension, (OID = 2.5.29.19).
  461. * <p>
  462. * The basic constraints extension identifies whether the subject
  463. * of the certificate is a Certificate Authority (CA) and
  464. * how deep a certification path may exist through that CA. The
  465. * <code>pathLenConstraint</code> field (see below) is meaningful
  466. * only if <code>cA</code> is set to TRUE. In this case, it gives the
  467. * maximum number of CA certificates that may follow this certificate in a
  468. * certification path. A value of zero indicates that only an end-entity
  469. * certificate may follow in the path.
  470. * <p>
  471. * Note that for RFC 2459 this extension is always marked
  472. * critical if <code>cA</code> is TRUE, meaning this certificate belongs
  473. * to a Certificate Authority.
  474. * <p>
  475. * The ASN.1 definition for this is:
  476. * <pre>
  477. * BasicConstraints ::= SEQUENCE {
  478. * cA BOOLEAN DEFAULT FALSE,
  479. * pathLenConstraint INTEGER (0..MAX) OPTIONAL }
  480. * </pre>
  481. *
  482. * @return the value of <code>pathLenConstraint</code> if the
  483. * BasicConstraints extension is present in the certificate and the
  484. * subject of the certificate is a CA, otherwise -1.
  485. * If the subject of the certificate is a CA and
  486. * <code>pathLenConstraint</code> does not appear,
  487. * <code>Integer.MAX_VALUE</code> is returned to indicate that there is no
  488. * limit to the allowed length of the certification path.
  489. */
  490. public abstract int getBasicConstraints();
  491. /**
  492. * Gets an immutable collection of subject alternative names from the
  493. * <code>SubjectAltName</code> extension, (OID = 2.5.29.17).
  494. * <p>
  495. * The ASN.1 definition of the <code>SubjectAltName</code> extension is:
  496. * <pre>
  497. * SubjectAltName ::= GeneralNames
  498. *
  499. * GeneralNames :: = SEQUENCE SIZE (1..MAX) OF GeneralName
  500. *
  501. * GeneralName ::= CHOICE {
  502. * otherName [0] OtherName,
  503. * rfc822Name [1] IA5String,
  504. * dNSName [2] IA5String,
  505. * x400Address [3] ORAddress,
  506. * directoryName [4] Name,
  507. * ediPartyName [5] EDIPartyName,
  508. * uniformResourceIdentifier [6] IA5String,
  509. * iPAddress [7] OCTET STRING,
  510. * registeredID [8] OBJECT IDENTIFIER}
  511. * </pre>
  512. * <p>
  513. * If this certificate does not contain a <code>SubjectAltName</code>
  514. * extension, <code>null</code> is returned. Otherwise, a
  515. * <code>Collection</code> is returned with an entry representing each
  516. * <code>GeneralName</code> included in the extension. Each entry is a
  517. * <code>List</code> whose first entry is an <code>Integer</code>
  518. * (the name type, 0-8) and whose second entry is a <code>String</code>
  519. * or a byte array (the name, in string or ASN.1 DER encoded form,
  520. * respectively).
  521. * <p>
  522. * RFC 822, DNS, and URI names are returned as <code>String</code>s,
  523. * using the well-established string formats for those types (subject to
  524. * the restrictions included in RFC 2459). IPv4 address names are
  525. * returned using dotted quad notation. IPv6 address names are returned
  526. * in the form "a1:a2:...:a8", where a1-a8 are hexadecimal values
  527. * representing the eight 16-bit pieces of the address. OID names are
  528. * returned as <code>String</code>s represented as a series of nonnegative
  529. * integers separated by periods. And directory names (distinguished names)
  530. * are returned in RFC 2253 string format. No standard string format is
  531. * defined for otherNames, X.400 names, EDI party names, or any
  532. * other type of names. They are returned as byte arrays
  533. * containing the ASN.1 DER encoded form of the name.
  534. * <p>
  535. * Note that the <code>Collection</code> returned may contain more
  536. * than one name of the same type. Also, note that the returned
  537. * <code>Collection</code> is immutable and any entries containing byte
  538. * arrays are cloned to protect against subsequent modifications.
  539. * <p>
  540. * This method was added to version 1.4 of the Java 2 Platform Standard
  541. * Edition. In order to maintain backwards compatibility with existing
  542. * service providers, this method is not <code>abstract</code>
  543. * and it provides a default implementation. Subclasses
  544. * should override this method with a correct implementation.
  545. *
  546. * @return an immutable <code>Collection</code> of subject alternative
  547. * names (or <code>null</code>)
  548. * @throws CertificateParsingException if the extension cannot be decoded
  549. * @since 1.4
  550. */
  551. public Collection<List<?>> getSubjectAlternativeNames()
  552. throws CertificateParsingException {
  553. return X509CertImpl.getSubjectAlternativeNames(this);
  554. }
  555. /**
  556. * Gets an immutable collection of issuer alternative names from the
  557. * <code>IssuerAltName</code> extension, (OID = 2.5.29.18).
  558. * <p>
  559. * The ASN.1 definition of the <code>IssuerAltName</code> extension is:
  560. * <pre>
  561. * IssuerAltName ::= GeneralNames
  562. * </pre>
  563. * The ASN.1 definition of <code>GeneralNames</code> is defined
  564. * in {@link #getSubjectAlternativeNames getSubjectAlternativeNames}.
  565. * <p>
  566. * If this certificate does not contain an <code>IssuerAltName</code>
  567. * extension, <code>null</code> is returned. Otherwise, a
  568. * <code>Collection</code> is returned with an entry representing each
  569. * <code>GeneralName</code> included in the extension. Each entry is a
  570. * <code>List</code> whose first entry is an <code>Integer</code>
  571. * (the name type, 0-8) and whose second entry is a <code>String</code>
  572. * or a byte array (the name, in string or ASN.1 DER encoded form,
  573. * respectively). For more details about the formats used for each
  574. * name type, see the <code>getSubjectAlternativeNames</code> method.
  575. * <p>
  576. * Note that the <code>Collection</code> returned may contain more
  577. * than one name of the same type. Also, note that the returned
  578. * <code>Collection</code> is immutable and any entries containing byte
  579. * arrays are cloned to protect against subsequent modifications.
  580. * <p>
  581. * This method was added to version 1.4 of the Java 2 Platform Standard
  582. * Edition. In order to maintain backwards compatibility with existing
  583. * service providers, this method is not <code>abstract</code>
  584. * and it provides a default implementation. Subclasses
  585. * should override this method with a correct implementation.
  586. *
  587. * @return an immutable <code>Collection</code> of issuer alternative
  588. * names (or <code>null</code>)
  589. * @throws CertificateParsingException if the extension cannot be decoded
  590. * @since 1.4
  591. */
  592. public Collection<List<?>> getIssuerAlternativeNames()
  593. throws CertificateParsingException {
  594. return X509CertImpl.getIssuerAlternativeNames(this);
  595. }
  596. }