本文整理汇总了Java中org.bouncycastle.asn1.DERObjectIdentifier.getId方法的典型用法代码示例。如果您正苦于以下问题:Java DERObjectIdentifier.getId方法的具体用法?Java DERObjectIdentifier.getId怎么用?Java DERObjectIdentifier.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.asn1.DERObjectIdentifier
的用法示例。
在下文中一共展示了DERObjectIdentifier.getId方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getByOID
import org.bouncycastle.asn1.DERObjectIdentifier; //导入方法依赖的package包/类
/**
* return the X9ECParameters object for the named curve represented by
* the passed in object identifier. Null if the curve isn't present.
*
* @param oid an object identifier representing a named curve, if present.
*/
public static X9ECParameters getByOID(
DERObjectIdentifier oid)
{
X9ECParameters result = (X9ECParameters)curves.get(oid);
if ( result == null ){
String id = oid.getId();
if ( !missing_oids.contains( id )){
missing_oids.add( id );
new Exception( "Missing named curve: " + id ).printStackTrace();
}
}
return( result );
}
示例2: processCertD1i
import org.bouncycastle.asn1.DERObjectIdentifier; //导入方法依赖的package包/类
protected static boolean processCertD1i(
int index,
List[] policyNodes,
DERObjectIdentifier pOid,
Set pq)
{
List policyNodeVec = policyNodes[index - 1];
for (int j = 0; j < policyNodeVec.size(); j++)
{
PKIXPolicyNode node = (PKIXPolicyNode)policyNodeVec.get(j);
Set expectedPolicies = node.getExpectedPolicies();
if (expectedPolicies.contains(pOid.getId()))
{
Set childExpectedPolicies = new HashSet();
childExpectedPolicies.add(pOid.getId());
PKIXPolicyNode child = new PKIXPolicyNode(new ArrayList(),
index,
childExpectedPolicies,
node,
pq,
pOid.getId(),
false);
node.addChild(child);
policyNodes[index].add(child);
return true;
}
}
return false;
}
示例3: processCertD1ii
import org.bouncycastle.asn1.DERObjectIdentifier; //导入方法依赖的package包/类
protected static void processCertD1ii(
int index,
List[] policyNodes,
DERObjectIdentifier _poid,
Set _pq)
{
List policyNodeVec = policyNodes[index - 1];
for (int j = 0; j < policyNodeVec.size(); j++)
{
PKIXPolicyNode _node = (PKIXPolicyNode)policyNodeVec.get(j);
if (ANY_POLICY.equals(_node.getValidPolicy()))
{
Set _childExpectedPolicies = new HashSet();
_childExpectedPolicies.add(_poid.getId());
PKIXPolicyNode _child = new PKIXPolicyNode(new ArrayList(),
index,
_childExpectedPolicies,
_node,
_pq,
_poid.getId(),
false);
_node.addChild(_child);
policyNodes[index].add(_child);
return;
}
}
}
示例4: DHKDFParameters
import org.bouncycastle.asn1.DERObjectIdentifier; //导入方法依赖的package包/类
public DHKDFParameters(
DERObjectIdentifier algorithm,
int keySize,
byte[] z,
byte[] extraInfo)
{
this.algorithm = new ASN1ObjectIdentifier(algorithm.getId());
this.keySize = keySize;
this.z = z;
this.extraInfo = extraInfo;
}
示例5: AlgorithmIdentifier
import org.bouncycastle.asn1.DERObjectIdentifier; //导入方法依赖的package包/类
/**
* @deprecated use ASN1ObjectIdentifier
* @param objectId
* @param parameters
*/
public AlgorithmIdentifier(
DERObjectIdentifier objectId,
ASN1Encodable parameters)
{
parametersDefined = true;
this.objectId = new ASN1ObjectIdentifier(objectId.getId());
this.parameters = parameters;
}
示例6: Attribute
import org.bouncycastle.asn1.DERObjectIdentifier; //导入方法依赖的package包/类
/**
* @deprecated use ASN1ObjectIdentifier
*/
public Attribute(
DERObjectIdentifier attrType,
ASN1Set attrValues)
{
this.attrType = new ASN1ObjectIdentifier(attrType.getId());
this.attrValues = attrValues;
}
示例7: ContentHints
import org.bouncycastle.asn1.DERObjectIdentifier; //导入方法依赖的package包/类
/**
* @deprecated use ASN1ObjectIdentifier
*/
public ContentHints(
DERObjectIdentifier contentType,
DERUTF8String contentDescription)
{
this(new ASN1ObjectIdentifier(contentType.getId()), contentDescription);
}
示例8: getAlgorithmName
import org.bouncycastle.asn1.DERObjectIdentifier; //导入方法依赖的package包/类
static String getAlgorithmName(
DERObjectIdentifier oid)
{
if (oids.containsKey(oid))
{
return (String)oids.get(oid);
}
return oid.getId();
}
示例9: getConvertedValue
import org.bouncycastle.asn1.DERObjectIdentifier; //导入方法依赖的package包/类
/**
* Apply default coversion for the given value depending on the oid
* and the character range of the value.
*
* @param oid the object identifier for the DN entry
* @param value the value associated with it
* @return the ASN.1 equivalent for the string value.
*/
public DERObject getConvertedValue(
DERObjectIdentifier oid,
String value)
{
if (value.length() != 0 && value.charAt(0) == '#')
{
try
{
return convertHexEncoded(value, 1);
}
catch (IOException e)
{
throw new RuntimeException("can't recode value for oid " + oid.getId());
}
}
else if (oid.equals(X509Name.EmailAddress) || oid.equals(X509Name.DC))
{
return new DERIA5String(value);
}
else if (oid.equals(X509Name.DATE_OF_BIRTH)) // accept time string as well as # (for compatibility)
{
return new DERGeneralizedTime(value);
}
else if (oid.equals(X509Name.C) || oid.equals(X509Name.SN) || oid.equals(X509Name.DN_QUALIFIER))
{
return new DERPrintableString(value);
}
return new DERUTF8String(value);
}
示例10: X509Name
import org.bouncycastle.asn1.DERObjectIdentifier; //导入方法依赖的package包/类
/**
* Constructor from a table of attributes with ordering.
* <p>
* it's is assumed the table contains OID/String pairs, and the contents
* of the table are copied into an internal table as part of the
* construction process. The ordering vector should contain the OIDs
* in the order they are meant to be encoded or printed in toString.
* <p>
* The passed in converter will be used to convert the strings into their
* ASN.1 counterparts.
*/
public X509Name(
Vector ordering,
Hashtable attributes,
X509NameEntryConverter converter)
{
this.converter = converter;
if (ordering != null)
{
for (int i = 0; i != ordering.size(); i++)
{
this.ordering.addElement(ordering.elementAt(i));
this.added.addElement(FALSE);
}
}
else
{
Enumeration e = attributes.keys();
while (e.hasMoreElements())
{
this.ordering.addElement(e.nextElement());
this.added.addElement(FALSE);
}
}
for (int i = 0; i != this.ordering.size(); i++)
{
DERObjectIdentifier oid = (DERObjectIdentifier)this.ordering.elementAt(i);
if (attributes.get(oid) == null)
{
throw new IllegalArgumentException("No attribute for object id - " + oid.getId() + " - passed to distinguished name");
}
this.values.addElement(attributes.get(oid)); // copy the hash table
}
}
示例11: getDigestAlgName
import org.bouncycastle.asn1.DERObjectIdentifier; //导入方法依赖的package包/类
/**
* Return the digest algorithm using one of the standard JCA string
* representations rather the the algorithm identifier (if possible).
*/
private static String getDigestAlgName(
DERObjectIdentifier digestAlgOID)
{
if (PKCSObjectIdentifiers.md5.equals(digestAlgOID))
{
return "MD5";
}
else if (OIWObjectIdentifiers.idSHA1.equals(digestAlgOID))
{
return "SHA1";
}
else if (NISTObjectIdentifiers.id_sha224.equals(digestAlgOID))
{
return "SHA224";
}
else if (NISTObjectIdentifiers.id_sha256.equals(digestAlgOID))
{
return "SHA256";
}
else if (NISTObjectIdentifiers.id_sha384.equals(digestAlgOID))
{
return "SHA384";
}
else if (NISTObjectIdentifiers.id_sha512.equals(digestAlgOID))
{
return "SHA512";
}
else if (TeleTrusTObjectIdentifiers.ripemd128.equals(digestAlgOID))
{
return "RIPEMD128";
}
else if (TeleTrusTObjectIdentifiers.ripemd160.equals(digestAlgOID))
{
return "RIPEMD160";
}
else if (TeleTrusTObjectIdentifiers.ripemd256.equals(digestAlgOID))
{
return "RIPEMD256";
}
else if (CryptoProObjectIdentifiers.gostR3411.equals(digestAlgOID))
{
return "GOST3411";
}
else
{
return digestAlgOID.getId();
}
}
示例12: getDigestAlgName
import org.bouncycastle.asn1.DERObjectIdentifier; //导入方法依赖的package包/类
private static String getDigestAlgName(
DERObjectIdentifier digestAlgOID)
{
if (PKCSObjectIdentifiers.md5.equals(digestAlgOID))
{
return "MD5";
}
else if (OIWObjectIdentifiers.idSHA1.equals(digestAlgOID))
{
return "SHA1";
}
else if (NISTObjectIdentifiers.id_sha224.equals(digestAlgOID))
{
return "SHA224";
}
else if (NISTObjectIdentifiers.id_sha256.equals(digestAlgOID))
{
return "SHA256";
}
else if (NISTObjectIdentifiers.id_sha384.equals(digestAlgOID))
{
return "SHA384";
}
else if (NISTObjectIdentifiers.id_sha512.equals(digestAlgOID))
{
return "SHA512";
}
else if (TeleTrusTObjectIdentifiers.ripemd128.equals(digestAlgOID))
{
return "RIPEMD128";
}
else if (TeleTrusTObjectIdentifiers.ripemd160.equals(digestAlgOID))
{
return "RIPEMD160";
}
else if (TeleTrusTObjectIdentifiers.ripemd256.equals(digestAlgOID))
{
return "RIPEMD256";
}
else if (CryptoProObjectIdentifiers.gostR3411.equals(digestAlgOID))
{
return "GOST3411";
}
else
{
return digestAlgOID.getId();
}
}
示例13: getAIAComplete
import org.bouncycastle.asn1.DERObjectIdentifier; //导入方法依赖的package包/类
public static Map<String, String> getAIAComplete(byte[] ext)
throws UnsupportedEncodingException {
Map<String, String> ret = new HashMap<String, String>();
try {
if (ext == null)
return null;
ASN1InputStream oAsnInStream = new ASN1InputStream(
new ByteArrayInputStream(ext));
DERObject derObjAIA = oAsnInStream.readObject();
DEROctetString dosAia = (DEROctetString) derObjAIA;
byte[] aiaExtOctets = dosAia.getOctets();
// ------------ level 2
ASN1InputStream oAsnInStream2 = new ASN1InputStream(
new ByteArrayInputStream(aiaExtOctets));
DERObject derObj2 = oAsnInStream2.readObject();
ASN1Sequence aiaDLSeq = (ASN1Sequence) derObj2;
// DEREncodable[] aiaAsArray = aiaDLSeq.toArray();
int aiaDLSeqLen = aiaDLSeq.size();
for (int i = 0; i < aiaDLSeqLen; i++) {
DEREncodable next = aiaDLSeq.getObjectAt(i);
ASN1Sequence aiaDLSeq2 = (ASN1Sequence) next;
// DEREncodable[] aiaAsArray2 = aiaDLSeq2.toArray();
// oid = 0 / content = 1
DEREncodable aiaOidEnc = aiaDLSeq2.getObjectAt(0);
DERObjectIdentifier aiaOid = (DERObjectIdentifier) aiaOidEnc;
String idStr = aiaOid.getId();
// if (idStr.compareTo("1.3.6.1.5.5.7.48.2") == 0) {
DEREncodable aiaContent = aiaDLSeq2.getObjectAt(1);
DERTaggedObject aiaDTO = (DERTaggedObject) aiaContent;
DERObject aiaObj = aiaDTO.getObject();
DEROctetString aiaDOS = (DEROctetString) aiaObj;
byte[] aiaOC = aiaDOS.getOctets();
ret.put(idStr, new String(aiaOC));
// break;
// }
}
} catch (Exception e) {
LOG.error("Error extracting AIA", e);
}
return ret;
}
示例14: NamingAuthority
import org.bouncycastle.asn1.DERObjectIdentifier; //导入方法依赖的package包/类
/**
* Constructor from given details.
* <p/>
* All parameters can be combined.
*
* @param namingAuthorityId ObjectIdentifier for naming authority.
* @param namingAuthorityUrl URL for naming authority.
* @param namingAuthorityText Textual representation of naming authority.
* @deprecated use ASN1ObjectIdentifier method
*/
public NamingAuthority(DERObjectIdentifier namingAuthorityId,
String namingAuthorityUrl, DirectoryString namingAuthorityText)
{
this.namingAuthorityId = new ASN1ObjectIdentifier(namingAuthorityId.getId());
this.namingAuthorityUrl = namingAuthorityUrl;
this.namingAuthorityText = namingAuthorityText;
}