1 2 package com.ca.commons.security.cert.extensions; 3 4 import com.ca.commons.security.asn1.*; 5 import com.ca.commons.cbutil.CBParse; 6 7 15 public class SubjectKeyIdentifier implements V3Extension 16 { 17 String value = null; 18 byte [] keyId; 19 20 public byte [] getKeyId() { return keyId; } 21 22 public void init(ASN1Object asn1object) throws Exception 23 { 24 if (!asn1object.isASN1Type(ASN1Type.OCTET_STRING)) 25 throw new Exception ("Wrong ASN.1 type for SubjectKeyIdentifier"); 26 27 keyId = (byte[]) asn1object.getValue(); 28 value = CBParse.bytes2HexSplit(keyId, 4); 29 } 30 31 public String toString() 32 { 33 return value; 34 } 35 } 36 37 | Popular Tags |