1/* 2 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 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 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25/* 26 * $Id: X509IssuerSerial.java,v 1.4 2005/05/10 16:35:35 mullan Exp $ 27 */ 28package javax.xml.crypto.dsig.keyinfo; 29 30import java.math.BigInteger; 31import java.security.cert.X509Certificate; 32import javax.xml.crypto.XMLStructure; 33 34/** 35 * A representation of the XML <code>X509IssuerSerial</code> element as 36 * defined in the <a href="http://www.w3.org/TR/xmldsig-core/"> 37 * W3C Recommendation for XML-Signature Syntax and Processing</a>. 38 * An <code>X509IssuerSerial</code> object contains an X.509 issuer 39 * distinguished name (DN) and serial number pair. The XML schema definition is 40 * defined as: 41 * 42 * <pre> 43 * <element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/> 44 * <complexType name="X509IssuerSerialType"> 45 * <sequence> 46 * <element name="X509IssuerName" type="string"/> 47 * <element name="X509SerialNumber" type="integer"/> 48 * </sequence> 49 * </complexType> 50 * </pre> 51 * 52 * An <code>X509IssuerSerial</code> instance may be created by invoking the 53 * {@link KeyInfoFactory#newX509IssuerSerial newX509IssuerSerial} method 54 * of the {@link KeyInfoFactory} class, and passing it a 55 * <code>String</code> and <code>BigInteger</code> representing the X.500 56 * DN and serial number. Here is an example of creating an 57 * <code>X509IssuerSerial</code> from the issuer DN and serial number of an 58 * existing {@link X509Certificate}: 59 * <pre> 60 * KeyInfoFactory factory = KeyInfoFactory.getInstance("DOM"); 61 * X509IssuerSerial issuer = factory.newX509IssuerSerial 62 * (cert.getIssuerX500Principal().getName(), cert.getSerialNumber()); 63 * </pre> 64 * 65 * @author Sean Mullan 66 * @author JSR 105 Expert Group 67 * @since 1.6 68 * @see X509Data#getContent 69 * @see KeyInfoFactory#newX509IssuerSerial(String, BigInteger) 70 */ 71public interface X509IssuerSerial extends XMLStructure { 72 73 /** 74 * Returns the X.500 distinguished name of this 75 * <code>X509IssuerSerial</code> in 76 * <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a> String format. 77 * 78 * @return the X.500 distinguished name in RFC 2253 String format (never 79 * <code>null</code>) 80 */ 81 String getIssuerName(); 82 83 /** 84 * Returns the serial number of this <code>X509IssuerSerial</code>. 85 * 86 * @return the serial number (never <code>null</code>) 87 */ 88 BigInteger getSerialNumber(); 89} 90