32 import sun.security.x509.KeyIdentifier; 33 import sun.security.util.DerValue; 34 35 /** 36 * Class for ResponderId entities as described in RFC6960. ResponderId objects 37 * are used to uniquely identify OCSP responders. 38 * <p> 39 * The RFC 6960 defines a ResponderID structure as: 40 * <pre> 41 * ResponderID ::= CHOICE { 42 * byName [1] Name, 43 * byKey [2] KeyHash } 44 * 45 * KeyHash ::= OCTET STRING -- SHA-1 hash of responder's public key 46 * (excluding the tag and length fields) 47 * 48 * Name is defined in RFC 5280. 49 * </pre> 50 * 51 * @see ResponderId.Type 52 * @since 1.9 53 */ 54 public final class ResponderId { 55 56 /** 57 * A {@code ResponderId} enumeration describing the accepted forms for a 58 * {@code ResponderId}. 59 * 60 * @see ResponderId 61 * @since 1.9 62 */ 63 public static enum Type { 64 /** 65 * A BY_NAME {@code ResponderId} will be built from a subject name, 66 * either as an {@code X500Principal} or a DER-encoded byte array. 67 */ 68 BY_NAME(1, "byName"), 69 70 /** 71 * A BY_KEY {@code ResponderId} will be built from a public key 72 * identifier, either derived from a {@code PublicKey} or directly 73 * from a DER-encoded byte array containing the key identifier. 74 */ 75 BY_KEY(2, "byKey"); 76 77 private final int tagNumber; 78 private final String ridTypeName; 79 80 private Type(int value, String name) { 81 this.tagNumber = value; | 32 import sun.security.x509.KeyIdentifier; 33 import sun.security.util.DerValue; 34 35 /** 36 * Class for ResponderId entities as described in RFC6960. ResponderId objects 37 * are used to uniquely identify OCSP responders. 38 * <p> 39 * The RFC 6960 defines a ResponderID structure as: 40 * <pre> 41 * ResponderID ::= CHOICE { 42 * byName [1] Name, 43 * byKey [2] KeyHash } 44 * 45 * KeyHash ::= OCTET STRING -- SHA-1 hash of responder's public key 46 * (excluding the tag and length fields) 47 * 48 * Name is defined in RFC 5280. 49 * </pre> 50 * 51 * @see ResponderId.Type 52 * @since 9 53 */ 54 public final class ResponderId { 55 56 /** 57 * A {@code ResponderId} enumeration describing the accepted forms for a 58 * {@code ResponderId}. 59 * 60 * @see ResponderId 61 * @since 9 62 */ 63 public static enum Type { 64 /** 65 * A BY_NAME {@code ResponderId} will be built from a subject name, 66 * either as an {@code X500Principal} or a DER-encoded byte array. 67 */ 68 BY_NAME(1, "byName"), 69 70 /** 71 * A BY_KEY {@code ResponderId} will be built from a public key 72 * identifier, either derived from a {@code PublicKey} or directly 73 * from a DER-encoded byte array containing the key identifier. 74 */ 75 BY_KEY(2, "byKey"); 76 77 private final int tagNumber; 78 private final String ridTypeName; 79 80 private Type(int value, String name) { 81 this.tagNumber = value; |