本文整理汇总了Java中org.bouncycastle.asn1.cmp.PKIFreeText类的典型用法代码示例。如果您正苦于以下问题:Java PKIFreeText类的具体用法?Java PKIFreeText怎么用?Java PKIFreeText使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PKIFreeText类属于org.bouncycastle.asn1.cmp包,在下文中一共展示了PKIFreeText类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStatusString
import org.bouncycastle.asn1.cmp.PKIFreeText; //导入依赖的package包/类
public String getStatusString()
{
if (resp.getStatus().getStatusString() != null)
{
StringBuffer statusStringBuf = new StringBuffer();
PKIFreeText text = resp.getStatus().getStatusString();
for (int i = 0; i != text.size(); i++)
{
statusStringBuf.append(text.getStringAt(i).getString());
}
return statusStringBuf.toString();
}
else
{
return null;
}
}
示例2: getPKIStatusInfo
import org.bouncycastle.asn1.cmp.PKIFreeText; //导入依赖的package包/类
private PKIStatusInfo getPKIStatusInfo()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(new DERInteger(status));
if (statusStrings.size() > 0)
{
v.add(PKIFreeText.getInstance(new DERSequence(statusStrings)));
}
if (failInfo != 0)
{
DERBitString failInfoBitString = new FailInfo(failInfo);
v.add(failInfoBitString);
}
return PKIStatusInfo.getInstance(new DERSequence(v));
}
示例3: getPKIStatusInfo
import org.bouncycastle.asn1.cmp.PKIFreeText; //导入依赖的package包/类
private PKIStatusInfo getPKIStatusInfo()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(new ASN1Integer(status));
if (statusStrings.size() > 0)
{
v.add(PKIFreeText.getInstance(new DERSequence(statusStrings)));
}
if (failInfo != 0)
{
DERBitString failInfoBitString = new FailInfo(failInfo);
v.add(failInfoBitString);
}
return PKIStatusInfo.getInstance(new DERSequence(v));
}
示例4: setFreeText
import org.bouncycastle.asn1.cmp.PKIFreeText; //导入依赖的package包/类
/**
* Include a human-readable message in the new message.
*
* @param freeText the contents of the human readable message,
* @return the current builder instance.
*/
public ProtectedPKIMessageBuilder setFreeText(PKIFreeText freeText)
{
hdrBuilder.setFreeText(freeText);
return this;
}
示例5: formatPkiStatusInfo
import org.bouncycastle.asn1.cmp.PKIFreeText; //导入依赖的package包/类
public static String formatPkiStatusInfo(
org.bouncycastle.asn1.cmp.PKIStatusInfo pkiStatusInfo) {
ParamUtil.requireNonNull("pkiStatusInfo", pkiStatusInfo);
int status = pkiStatusInfo.getStatus().intValue();
int failureInfo = pkiStatusInfo.getFailInfo().intValue();
PKIFreeText text = pkiStatusInfo.getStatusString();
String statusMessage = (text == null) ? null : text.getStringAt(0).getString();
return formatPkiStatusInfo(status, failureInfo, statusMessage);
}
示例6: PkiStatusInfo
import org.bouncycastle.asn1.cmp.PKIFreeText; //导入依赖的package包/类
public PkiStatusInfo(org.bouncycastle.asn1.cmp.PKIStatusInfo bcPkiStatusInfo) {
ParamUtil.requireNonNull("bcPkiStatusInfo", bcPkiStatusInfo);
this.status = bcPkiStatusInfo.getStatus().intValue();
this.pkiFailureInfo = (bcPkiStatusInfo.getFailInfo() == null)
? 0 : bcPkiStatusInfo.getFailInfo().intValue();
PKIFreeText text = bcPkiStatusInfo.getStatusString();
this.statusMessage = (text == null) ? null : text.getStringAt(0).getString();
}
示例7: buildErrorMsgPkiBody
import org.bouncycastle.asn1.cmp.PKIFreeText; //导入依赖的package包/类
private static PKIBody buildErrorMsgPkiBody(PKIStatus pkiStatus, int failureInfo,
String statusMessage) {
PKIFreeText pkiStatusMsg = (statusMessage == null) ? null : new PKIFreeText(statusMessage);
ErrorMsgContent emc = new ErrorMsgContent(
new PKIStatusInfo(pkiStatus, pkiStatusMsg, new PKIFailureInfo(failureInfo)));
return new PKIBody(PKIBody.TYPE_ERROR, emc);
}
示例8: cmpUnRevokeRemoveCertificates
import org.bouncycastle.asn1.cmp.PKIFreeText; //导入依赖的package包/类
private PKIBody cmpUnRevokeRemoveCertificates(PKIMessage request, PKIHeaderBuilder respHeader,
CmpControl cmpControl, PKIHeader reqHeader, PKIBody reqBody, CmpRequestorInfo requestor,
String msgId, AuditEvent event) {
Integer requiredPermission = null;
boolean allRevdetailsOfSameType = true;
RevReqContent rr = RevReqContent.getInstance(reqBody.getContent());
RevDetails[] revContent = rr.toRevDetailsArray();
int len = revContent.length;
for (int i = 0; i < len; i++) {
RevDetails revDetails = revContent[i];
Extensions crlDetails = revDetails.getCrlEntryDetails();
int reasonCode = CrlReason.UNSPECIFIED.code();
if (crlDetails != null) {
ASN1ObjectIdentifier extId = Extension.reasonCode;
ASN1Encodable extValue = crlDetails.getExtensionParsedValue(extId);
if (extValue != null) {
reasonCode = ASN1Enumerated.getInstance(extValue).getValue().intValue();
}
}
if (reasonCode == XiSecurityConstants.CMP_CRL_REASON_REMOVE) {
if (requiredPermission == null) {
event.addEventType(CaAuditConstants.TYPE_CMP_rr_remove);
requiredPermission = PermissionConstants.REMOVE_CERT;
} else if (requiredPermission != PermissionConstants.REMOVE_CERT) {
allRevdetailsOfSameType = false;
break;
}
} else if (reasonCode == CrlReason.REMOVE_FROM_CRL.code()) {
if (requiredPermission == null) {
event.addEventType(CaAuditConstants.TYPE_CMP_rr_unrevoke);
requiredPermission = PermissionConstants.UNREVOKE_CERT;
} else if (requiredPermission != PermissionConstants.UNREVOKE_CERT) {
allRevdetailsOfSameType = false;
break;
}
} else {
if (requiredPermission == null) {
event.addEventType(CaAuditConstants.TYPE_CMP_rr_revoke);
requiredPermission = PermissionConstants.REVOKE_CERT;
} else if (requiredPermission != PermissionConstants.REVOKE_CERT) {
allRevdetailsOfSameType = false;
break;
}
}
} // end for
if (!allRevdetailsOfSameType) {
ErrorMsgContent emc = new ErrorMsgContent(
new PKIStatusInfo(PKIStatus.rejection,
new PKIFreeText("not all revDetails are of the same type"),
new PKIFailureInfo(PKIFailureInfo.badRequest)));
return new PKIBody(PKIBody.TYPE_ERROR, emc);
} else {
try {
checkPermission(requestor, requiredPermission);
} catch (InsuffientPermissionException ex) {
event.setStatus(AuditStatus.FAILED);
event.addEventData(CaAuditConstants.NAME_message, "NOT_PERMITTED");
return buildErrorMsgPkiBody(PKIStatus.rejection, PKIFailureInfo.notAuthorized,
null);
}
return unRevokeRemoveCertificates(request, rr, requiredPermission, cmpControl, msgId);
}
}
示例9: generateRejectionStatus
import org.bouncycastle.asn1.cmp.PKIFreeText; //导入依赖的package包/类
protected PKIStatusInfo generateRejectionStatus(PKIStatus status, Integer info,
String errorMessage) {
PKIFreeText statusMessage = (errorMessage == null) ? null : new PKIFreeText(errorMessage);
PKIFailureInfo failureInfo = (info == null) ? null : new PKIFailureInfo(info);
return new PKIStatusInfo(status, statusMessage, failureInfo);
}