本文整理汇总了Java中org.bouncycastle.asn1.DERObjectIdentifier.equals方法的典型用法代码示例。如果您正苦于以下问题:Java DERObjectIdentifier.equals方法的具体用法?Java DERObjectIdentifier.equals怎么用?Java DERObjectIdentifier.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.asn1.DERObjectIdentifier
的用法示例。
在下文中一共展示了DERObjectIdentifier.equals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractAuthorityInformationAccess
import org.bouncycastle.asn1.DERObjectIdentifier; //导入方法依赖的package包/类
public static void extractAuthorityInformationAccess(List<String> OCSPUrl,
DERObject aiaExt) {
AuthorityInformationAccess aia = AuthorityInformationAccess
.getInstance(aiaExt);
AccessDescription[] accessDescriptions = aia.getAccessDescriptions();
DERObjectIdentifier OCSPOid = new DERObjectIdentifier(
"1.3.6.1.5.5.7.48.1"); //$NON-NLS-1$
for (AccessDescription accessDescription : accessDescriptions) {
GeneralName generalName = accessDescription.getAccessLocation();
String nextName = generalName.getName().toString();
DERObjectIdentifier acessMethod = accessDescription
.getAccessMethod();
if (acessMethod.equals(OCSPOid)) {
OCSPUrl.add(nextName);
}
}
}
示例2: extractAuthorityInformationAccess
import org.bouncycastle.asn1.DERObjectIdentifier; //导入方法依赖的package包/类
public static void extractAuthorityInformationAccess(List<String> OCSPUrl,
ASN1Primitive aiaExt) {
AuthorityInformationAccess aia = AuthorityInformationAccess
.getInstance(aiaExt);
AccessDescription[] accessDescriptions = aia.getAccessDescriptions();
DERObjectIdentifier OCSPOid = new DERObjectIdentifier(
"1.3.6.1.5.5.7.48.1"); //$NON-NLS-1$
for (AccessDescription accessDescription : accessDescriptions) {
GeneralName generalName = accessDescription.getAccessLocation();
String nextName = generalName.getName().toString();
DERObjectIdentifier acessMethod = accessDescription
.getAccessMethod();
if (acessMethod.equals(OCSPOid)) {
OCSPUrl.add(nextName);
}
}
}
示例3: 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);
}
示例4: equals
import org.bouncycastle.asn1.DERObjectIdentifier; //导入方法依赖的package包/类
/**
* @param inOrder if true the order of both X509 names must be the same,
* as well as the values associated with each element.
*/
public boolean equals(Object obj, boolean inOrder)
{
if (!inOrder)
{
return this.equals(obj);
}
if (obj == this)
{
return true;
}
if (!(obj instanceof X509Name || obj instanceof ASN1Sequence))
{
return false;
}
DERObject derO = ((DEREncodable)obj).getDERObject();
if (this.getDERObject().equals(derO))
{
return true;
}
X509Name other;
try
{
other = X509Name.getInstance(obj);
}
catch (IllegalArgumentException e)
{
return false;
}
int orderingSize = ordering.size();
if (orderingSize != other.ordering.size())
{
return false;
}
for (int i = 0; i < orderingSize; i++)
{
DERObjectIdentifier oid = (DERObjectIdentifier)ordering.elementAt(i);
DERObjectIdentifier oOid = (DERObjectIdentifier)other.ordering.elementAt(i);
if (oid.equals(oOid))
{
String value = (String)values.elementAt(i);
String oValue = (String)other.values.elementAt(i);
if (!equivalentStrings(value, oValue))
{
return false;
}
}
else
{
return false;
}
}
return true;
}