1 /* 2 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 3 */ 4 /* 5 * $Id: X509IssuerSerial.java,v 1.4 2005/05/10 16:35:35 mullan Exp $ 6 */ 7 package javax.xml.crypto.dsig.keyinfo; 8 9 import java.math.BigInteger; 10 import java.security.cert.X509Certificate; 11 import javax.xml.crypto.XMLStructure; 12 13 /** 14 * A representation of the XML <code>X509IssuerSerial</code> element as 15 * defined in the <a HREF="http://www.w3.org/TR/xmldsig-core/"> 16 * W3C Recommendation for XML-Signature Syntax and Processing</a>. 17 * An <code>X509IssuerSerial</code> object contains an X.509 issuer 18 * distinguished name (DN) and serial number pair. The XML schema definition is 19 * defined as: 20 * 21 * <pre> 22 * <element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/> 23 * <complexType name="X509IssuerSerialType"> 24 * <sequence> 25 * <element name="X509IssuerName" type="string"/> 26 * <element name="X509SerialNumber" type="integer"/> 27 * </sequence> 28 * </complexType> 29 * </pre> 30 * 31 * An <code>X509IssuerSerial</code> instance may be created by invoking the 32 * {@link KeyInfoFactory#newX509IssuerSerial newX509IssuerSerial} method 33 * of the {@link KeyInfoFactory} class, and passing it a 34 * <code>String</code> and <code>BigInteger</code> representing the X.500 35 * DN and serial number. Here is an example of creating an 36 * <code>X509IssuerSerial</code> from the issuer DN and serial number of an 37 * existing {@link X509Certificate}: 38 * <pre> 39 * KeyInfoFactory factory = KeyInfoFactory.getInstance("DOM"); 40 * X509IssuerSerial issuer = factory.newX509IssuerSerial 41 * (cert.getIssuerX500Principal().getName(), cert.getSerialNumber()); 42 * </pre> 43 * 44 * @author Sean Mullan 45 * @author JSR 105 Expert Group 46 * @since 1.6 47 * @see X509Data#getContent 48 * @see KeyInfoFactory#newX509IssuerSerial(String, BigInteger) 49 */ 50 public interface X509IssuerSerial extends XMLStructure { 51 52 /** 53 * Returns the X.500 distinguished name of this 54 * <code>X509IssuerSerial</code> in 55 * <a HREF="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a> String format. 56 * 57 * @return the X.500 distinguished name in RFC 2253 String format (never 58 * <code>null</code>) 59 */ 60 String getIssuerName(); 61 62 /** 63 * Returns the serial number of this <code>X509IssuerSerial</code>. 64 * 65 * @return the serial number (never <code>null</code>) 66 */ 67 BigInteger getSerialNumber(); 68 } 69