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


Java ASN1String.getString方法代码示例

本文整理汇总了Java中org.bouncycastle.asn1.ASN1String.getString方法的典型用法代码示例。如果您正苦于以下问题:Java ASN1String.getString方法的具体用法?Java ASN1String.getString怎么用?Java ASN1String.getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bouncycastle.asn1.ASN1String的用法示例。


在下文中一共展示了ASN1String.getString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRoleNameAsString

import org.bouncycastle.asn1.ASN1String; //导入方法依赖的package包/类
/**
 * Gets the role name as a <code>java.lang.String</code> object.
 * @return    the role name of this RoleSyntax represented as a 
 * <code>java.lang.String</code> object.
 */
public String getRoleNameAsString()
{
    ASN1String str = (ASN1String)this.roleName.getName();
    
    return str.getString();
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:12,代码来源:RoleSyntax.java

示例2: parseGn

import org.bouncycastle.asn1.ASN1String; //导入方法依赖的package包/类
private static String parseGn(GeneralName gn) {
	try {
		if (GeneralName.uniformResourceIdentifier == gn.getTagNo()) {
			ASN1String str = (ASN1String) ((DERTaggedObject) gn.toASN1Primitive()).getObject();
			return str.getString();
		}
	} catch (Exception e) {
		LOG.warn("Unable to parse GN " + gn, e);
	}
	return null;
}
 
开发者ID:esig,项目名称:dss,代码行数:12,代码来源:DSSASN1Utils.java

示例3: getChallengePassword

import org.bouncycastle.asn1.ASN1String; //导入方法依赖的package包/类
public static String getChallengePassword(CertificationRequestInfo csr) {
    ParamUtil.requireNonNull("csr", csr);
    ASN1Set attrs = csr.getAttributes();
    for (int i = 0; i < attrs.size(); i++) {
        Attribute attr = Attribute.getInstance(attrs.getObjectAt(i));
        if (PKCSObjectIdentifiers.pkcs_9_at_challengePassword.equals(attr.getAttrType())) {
            ASN1String str = (ASN1String) attr.getAttributeValues()[0];
            return str.getString();
        }
    }
    return null;
}
 
开发者ID:xipki,项目名称:xipki,代码行数:13,代码来源:CaUtil.java

示例4: getClaimedSignerRoles

import org.bouncycastle.asn1.ASN1String; //导入方法依赖的package包/类
@Override
public String[] getClaimedSignerRoles() {
	final Attribute id_aa_ets_signerAttr = getSignedAttribute(PKCSObjectIdentifiers.id_aa_ets_signerAttr);
	if (id_aa_ets_signerAttr == null) {
		return null;
	}
	final ASN1Set attrValues = id_aa_ets_signerAttr.getAttrValues();
	final ASN1Encodable attrValue = attrValues.getObjectAt(0);
	try {

		final SignerAttribute signerAttr = SignerAttribute.getInstance(attrValue);
		if (signerAttr == null) {
			return null;
		}
		final List<String> claimedRoles = new ArrayList<String>();
		final Object[] signerAttrValues = signerAttr.getValues();
		for (final Object signerAttrValue : signerAttrValues) {

			if (!(signerAttrValue instanceof org.bouncycastle.asn1.x509.Attribute[])) {

				continue;
			}
			final org.bouncycastle.asn1.x509.Attribute[] signerAttrValueArray = (org.bouncycastle.asn1.x509.Attribute[]) signerAttrValue;
			for (final org.bouncycastle.asn1.x509.Attribute claimedRole : signerAttrValueArray) {

				final ASN1Encodable[] attrValues1 = claimedRole.getAttrValues().toArray();
				for (final ASN1Encodable asn1Encodable : attrValues1) {
					if (asn1Encodable instanceof ASN1String) {
						ASN1String asn1String = (ASN1String) asn1Encodable;
						final String s = asn1String.getString();
						claimedRoles.add(s);
					}
				}
			}
		}
		final String[] strings = claimedRoles.toArray(new String[claimedRoles.size()]);
		return strings;
	} catch (Exception e) {
		LOG.error("Error when dealing with claimed signer roles: [" + attrValue.toString() + "]", e);
		return null;
	}
}
 
开发者ID:esig,项目名称:dss,代码行数:43,代码来源:CAdESSignature.java


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