本文整理汇总了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();
}
示例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;
}
示例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;
}
示例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;
}
}