本文整理汇总了Java中org.bouncycastle.asn1.DERUTF8String.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java DERUTF8String.getInstance方法的具体用法?Java DERUTF8String.getInstance怎么用?Java DERUTF8String.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.asn1.DERUTF8String
的用法示例。
在下文中一共展示了DERUTF8String.getInstance方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getControl
import org.bouncycastle.asn1.DERUTF8String; //导入方法依赖的package包/类
/**
* Return a control value of the specified type.
*
* @param type the type OID for the control value we are checking for.
* @return the control value if present, null otherwise.
*/
public Control getControl(ASN1ObjectIdentifier type)
{
AttributeTypeAndValue found = findControl(type);
if (found != null)
{
if (found.getType().equals(CRMFObjectIdentifiers.id_regCtrl_pkiArchiveOptions))
{
return new PKIArchiveControl(PKIArchiveOptions.getInstance(found.getValue()));
}
if (found.getType().equals(CRMFObjectIdentifiers.id_regCtrl_regToken))
{
return new RegTokenControl(DERUTF8String.getInstance(found.getValue()));
}
if (found.getType().equals(CRMFObjectIdentifiers.id_regCtrl_authenticator))
{
return new AuthenticatorControl(DERUTF8String.getInstance(found.getValue()));
}
}
return null;
}
示例2: SignerLocation
import org.bouncycastle.asn1.DERUTF8String; //导入方法依赖的package包/类
public SignerLocation(
DERUTF8String countryName,
DERUTF8String localityName,
ASN1Sequence postalAddress)
{
if (postalAddress != null && postalAddress.size() > 6)
{
throw new IllegalArgumentException("postal address must contain less than 6 strings");
}
if (countryName != null)
{
this.countryName = DERUTF8String.getInstance(countryName.toASN1Primitive());
}
if (localityName != null)
{
this.localityName = DERUTF8String.getInstance(localityName.toASN1Primitive());
}
if (postalAddress != null)
{
this.postalAddress = ASN1Sequence.getInstance(postalAddress.toASN1Primitive());
}
}
示例3: MetaData
import org.bouncycastle.asn1.DERUTF8String; //导入方法依赖的package包/类
private MetaData(ASN1Sequence seq)
{
this.hashProtected = ASN1Boolean.getInstance(seq.getObjectAt(0));
int index = 1;
if (index < seq.size() && seq.getObjectAt(index) instanceof DERUTF8String)
{
this.fileName = DERUTF8String.getInstance(seq.getObjectAt(index++));
}
if (index < seq.size() && seq.getObjectAt(index) instanceof DERIA5String)
{
this.mediaType = DERIA5String.getInstance(seq.getObjectAt(index++));
}
if (index < seq.size())
{
this.otherMetaData = Attributes.getInstance(seq.getObjectAt(index++));
}
}
示例4: getUPNStringFromSequence
import org.bouncycastle.asn1.DERUTF8String; //导入方法依赖的package包/类
/**
* Get UPN String.
*
* @param seq ASN1Sequence abstraction representing subject alternative name.
* First element is the object identifier, second is the object itself.
*
* @return UPN string or null
*/
private String getUPNStringFromSequence(final ASN1Sequence seq) {
if (seq != null) {
// First in sequence is the object identifier, that we must check
final DERObjectIdentifier id = DERObjectIdentifier.getInstance(seq.getObjectAt(0));
if (id != null && UPN_OBJECTID.equals(id.getId())) {
final ASN1TaggedObject obj = (ASN1TaggedObject) seq.getObjectAt(1);
final DERUTF8String str = DERUTF8String.getInstance(obj.getObject());
return str.getString();
}
}
return null;
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:21,代码来源:X509SubjectAlternativeNameUPNPrincipalResolver.java
示例5: ContentHints
import org.bouncycastle.asn1.DERUTF8String; //导入方法依赖的package包/类
/**
* constructor
*/
private ContentHints(ASN1Sequence seq)
{
ASN1Encodable field = seq.getObjectAt(0);
if (field.toASN1Primitive() instanceof DERUTF8String)
{
contentDescription = DERUTF8String.getInstance(field);
contentType = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(1));
}
else
{
contentType = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(0));
}
}
示例6: parseUPN
import org.bouncycastle.asn1.DERUTF8String; //导入方法依赖的package包/类
/**
* Parse UPN/otherName
*
* @param generalName otherName object
* @return UPN as string
*/
public static String parseUPN(GeneralName generalName) {
// OtherName ::= SEQUENCE {
// type-id OBJECT IDENTIFIER,
// value [0] EXPLICIT ANY DEFINED BY type-id }
ASN1Sequence otherName = (ASN1Sequence) generalName.getName();
ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier) otherName.getObjectAt(0);
if (UPN_OID.equals(oid.getId())) {
DERTaggedObject derTaggedObject = (DERTaggedObject) otherName.getObjectAt(1);
DERUTF8String upn = DERUTF8String.getInstance(derTaggedObject.getObject());
return MessageFormat.format(res.getString("GeneralNameUtil.OtherGeneralName"), "UPN", upn.getString());
}
// fallback to generic handling
ASN1Encodable value = otherName.getObjectAt(1);
try {
return MessageFormat.format(res.getString("GeneralNameUtil.OtherGeneralName"),
ObjectIdUtil.toString(oid),
HexUtil.getHexString(value.toASN1Primitive().getEncoded(ASN1Encoding.DER)));
} catch (IOException e) {
return MessageFormat.format(res.getString("GeneralNameUtil.OtherGeneralName"),
ObjectIdUtil.toString(oid),
"");
}
}
示例7: getInstance
import org.bouncycastle.asn1.DERUTF8String; //导入方法依赖的package包/类
public static final ErrorMessage getInstance(Object o)
{
if (o instanceof ErrorMessage)
{
return (ErrorMessage)o;
}
else if (o != null)
{
return new ErrorMessage(DERUTF8String.getInstance(o));
}
return null;
}
示例8: getInstance
import org.bouncycastle.asn1.DERUTF8String; //导入方法依赖的package包/类
public static final FetchPublicKeyMessage getInstance(Object o)
{
if (o instanceof FetchPublicKeyMessage)
{
return (FetchPublicKeyMessage)o;
}
else if (o != null)
{
return new FetchPublicKeyMessage(DERUTF8String.getInstance(o));
}
return null;
}
示例9: getInstance
import org.bouncycastle.asn1.DERUTF8String; //导入方法依赖的package包/类
public static final KeyIDMessage getInstance(Object o)
{
if (o instanceof KeyIDMessage)
{
return (KeyIDMessage)o;
}
else if (o != null)
{
return new KeyIDMessage(DERUTF8String.getInstance(o));
}
return null;
}
示例10: getInstance
import org.bouncycastle.asn1.DERUTF8String; //导入方法依赖的package包/类
public static final IDMessage getInstance(Object o)
{
if (o instanceof IDMessage)
{
return (IDMessage)o;
}
else if (o != null)
{
return new IDMessage(DERUTF8String.getInstance(o));
}
return null;
}