本文整理了Java中org.bouncycastle.asn1.DERPrintableString.<init>()
方法的一些代码示例,展示了DERPrintableString.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DERPrintableString.<init>()
方法的具体详情如下:
包路径:org.bouncycastle.asn1.DERPrintableString
类名称:DERPrintableString
方法名:<init>
[英]basic constructor - this does not validate the string
[中]基本构造函数-这不会验证字符串
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public LDSVersionInfo(String ldsVersion, String unicodeVersion)
{
this.ldsVersion = new DERPrintableString(ldsVersion);
this.unicodeVersion = new DERPrintableString(unicodeVersion);
}
代码示例来源:origin: redfish64/TinyTravelTracker
public LDSVersionInfo(String ldsVersion, String unicodeVersion)
{
this.ldsVersion = new DERPrintableString(ldsVersion);
this.unicodeVersion = new DERPrintableString(unicodeVersion);
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public Iso4217CurrencyCode(
String alphabetic)
{
if (alphabetic.length() > ALPHABETIC_MAXSIZE)
{
throw new IllegalArgumentException("wrong size in alphabetic code : max size is " + ALPHABETIC_MAXSIZE);
}
obj = new DERPrintableString(alphabetic);
}
代码示例来源:origin: redfish64/TinyTravelTracker
public Iso4217CurrencyCode(
String alphabetic)
{
if (alphabetic.length() > ALPHABETIC_MAXSIZE)
{
throw new IllegalArgumentException("wrong size in alphabetic code : max size is " + ALPHABETIC_MAXSIZE);
}
obj = new DERPrintableString(alphabetic);
}
代码示例来源:origin: stackoverflow.com
ObjectIdentifier dnOid = new ObjectIdentifier("1.3.6.1.4.1.311.88.2.1");
ObjectIdentifier ddOid = new ObjectIdentifier("1.3.6.1.4.1.311.88.2.2");
ASN1Set nameSet = new DERSet(new ASN1Encodable[] {new DERPrintableString("name")});
ASN1Set descriptionSet = new DERSet(new ASN1Encodable[] {new DERPrintableString("description"}));
Attribute documentName = new Attribute(dnOid, nameSet);
Attribute documentDescription = new Attribute(ddOid, descriptionSet);
代码示例来源:origin: com.google.code.jscep/jscep-api
private Attribute getMessageType() {
final DERObjectIdentifier attrType = SCEPObjectIdentifiers.messageType;
final ASN1Set attr = new DERSet(new DERPrintableString(Integer.toString(msgType.getValue())));
return new Attribute(attrType, attr);
}
代码示例来源:origin: com.google.code.jscep/jscep-api
private Attribute getTransactionId() {
final DERObjectIdentifier attrType = SCEPObjectIdentifiers.transId;
final ASN1Set attrValues = new DERSet(new DERPrintableString(transId.getBytes()));
return new Attribute(attrType, attrValues);
}
代码示例来源:origin: stackoverflow.com
// Create Organization Name<br/>
DERObjectIdentifier oidOrgName = new DERObjectIdentifier("2.5.4.10");
DERPrintableString prntstrOrgName = new DERPrintableString("Test Organization");
DERSet setOrgName = new DERSet(new DERSequence(new ASN1Encodable[] {oidOrgName, prntstrOrgName}));
// Create org unit name
DERObjectIdentifier oidOrgUnitName = new DERObjectIdentifier(2.5.4.11);
DERPrintableString prntstrOrgUnitName = new DERPrintableString("Org Unit Name");
DERSet setOrgUnitName = new DERSet(new DERSequence(new ASN1Encodable[] {oidOrgUnitName, prntstrOrgUnitName}));
代码示例来源:origin: jscep/jscep
/**
* @param failInfo
* the failure reason to convert.
* @return the converted attribute.
*/
private Attribute toAttribute(final FailInfo failInfo) {
ASN1ObjectIdentifier oid = toOid(FAIL_INFO.id());
return new Attribute(oid, new DERSet(new DERPrintableString(
Integer.toString(failInfo.getValue()))));
}
代码示例来源:origin: jscep/jscep
/**
* @param pkiStatus
* the PKI status.
* @return the converted attribute.
*/
private Attribute toAttribute(final PkiStatus pkiStatus) {
ASN1ObjectIdentifier oid = toOid(PKI_STATUS.id());
return new Attribute(oid, new DERSet(new DERPrintableString(
Integer.toString(pkiStatus.getValue()))));
}
代码示例来源:origin: jscep/jscep
/**
* @param messageType
* the message type.
* @return the converted attribute.
*/
private Attribute toAttribute(final MessageType messageType) {
ASN1ObjectIdentifier oid = toOid(MESSAGE_TYPE.id());
return new Attribute(oid, new DERSet(new DERPrintableString(
Integer.toString(messageType.getValue()))));
}
代码示例来源:origin: jscep/jscep
/**
*
* @param transId
* the transaction ID
* @return the converted attribute.
*/
private Attribute toAttribute(final TransactionId transId) {
ASN1ObjectIdentifier oid = toOid(TRANS_ID.id());
return new Attribute(oid, new DERSet(new DERPrintableString(
transId.toString())));
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
/**
* Constructor from a given details.
* <p>
* value = amount�10^exponent
*
* @param currency The currency. Must be the ISO code.
* @param amount The amount
* @param exponent The exponent
*/
public MonetaryLimit(String currency, int amount, int exponent)
{
this.currency = new DERPrintableString(currency, true);
this.amount = new ASN1Integer(amount);
this.exponent = new ASN1Integer(exponent);
}
代码示例来源:origin: redfish64/TinyTravelTracker
/**
* Constructor from a given details.
* <p>
* value = amount�10^exponent
*
* @param currency The currency. Must be the ISO code.
* @param amount The amount
* @param exponent The exponent
*/
public MonetaryLimit(String currency, int amount, int exponent)
{
this.currency = new DERPrintableString(currency, true);
this.amount = new ASN1Integer(amount);
this.exponent = new ASN1Integer(exponent);
}
代码示例来源:origin: com.google.code.jscep/jscep-api
/**
* Creates an ASN1Set suitable for use in an ASN1 Attribute.
*
* @param password the password to use.
* @return the set.
*/
private static ASN1Set toSet(String password) {
final ASN1EncodableVector v = new ASN1EncodableVector();
v.add(new DERPrintableString(password));
return new DERSet(v);
}
代码示例来源:origin: com.google.code.jscep/jscep-api
private Attribute getStatus() {
DERPrintableString attr = new DERPrintableString(Integer.toString(pkiStatus.getValue()));
return new Attribute(SCEPObjectIdentifiers.pkiStatus, new DERSet(attr));
}
代码示例来源:origin: com.google.code.jscep/jscep-api
private Attribute getFailInfo() {
DERPrintableString attr = new DERPrintableString(Integer.toString(failInfo.getValue()));
return new Attribute(SCEPObjectIdentifiers.failInfo, new DERSet(attr));
}
代码示例来源:origin: xipki/xipki
protected static CertificationRequest genCsr(MyKeypair keypair, String subject,
String challengePassword) throws GeneralSecurityException, OperatorCreationException {
X500Name subjectDn = new X500Name(subject);
PKCS10CertificationRequestBuilder csrBuilder = new PKCS10CertificationRequestBuilder(
subjectDn, keypair.publicKeyInfo);
if (challengePassword != null && !challengePassword.isEmpty()) {
csrBuilder.addAttribute(PKCSObjectIdentifiers.pkcs_9_at_challengePassword,
new DERPrintableString(challengePassword));
}
ContentSigner signer = buildSigner(keypair.privateKey, "SHA256");
return csrBuilder.build(signer).toASN1Structure();
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
protected ASN1Encodable encodeStringValue(ASN1ObjectIdentifier oid,
String value) {
if (oid.equals(dc))
{
return new DERIA5String(value);
}
else if (oid.equals(c) || oid.equals(serialNumber) || oid.equals(dnQualifier)
|| oid.equals(telephoneNumber))
{
return new DERPrintableString(value);
}
return super.encodeStringValue(oid, value);
}
代码示例来源:origin: redfish64/TinyTravelTracker
protected ASN1Encodable encodeStringValue(ASN1ObjectIdentifier oid,
String value) {
if (oid.equals(dc))
{
return new DERIA5String(value);
}
else if (oid.equals(c) || oid.equals(serialNumber) || oid.equals(dnQualifier)
|| oid.equals(telephoneNumber))
{
return new DERPrintableString(value);
}
return super.encodeStringValue(oid, value);
}
内容来源于网络,如有侵权,请联系作者删除!