当前位置: 首页>>代码示例>>Java>>正文


Java DERObjectIdentifier.equals方法代码示例

本文整理汇总了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);
		}
	}
}
 
开发者ID:bluecrystalsign,项目名称:signer-source,代码行数:18,代码来源:DerEncoder.java

示例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);
		}
	}
}
 
开发者ID:bluecrystalsign,项目名称:signer-source,代码行数:18,代码来源:DerEncoder.java

示例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);
}
 
开发者ID:AcademicTorrents,项目名称:AcademicTorrents-Downloader,代码行数:39,代码来源:X509DefaultEntryConverter.java

示例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;
}
 
开发者ID:AcademicTorrents,项目名称:AcademicTorrents-Downloader,代码行数:70,代码来源:X509Name.java


注:本文中的org.bouncycastle.asn1.DERObjectIdentifier.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。