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


Java PKIFreeText类代码示例

本文整理汇总了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;
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:TimeStampResponse.java

示例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));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:20,代码来源:TimeStampResponseGenerator.java

示例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));
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:20,代码来源:TimeStampResponseGenerator.java

示例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;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:13,代码来源:ProtectedPKIMessageBuilder.java

示例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);
}
 
开发者ID:xipki,项目名称:xitk,代码行数:10,代码来源:CmpFailureUtil.java

示例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();
}
 
开发者ID:xipki,项目名称:xitk,代码行数:10,代码来源:PkiStatusInfo.java

示例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);
}
 
开发者ID:xipki,项目名称:xipki,代码行数:8,代码来源:X509CaCmpResponderImpl.java

示例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);
    }
}
 
开发者ID:xipki,项目名称:xipki,代码行数:69,代码来源:X509CaCmpResponderImpl.java

示例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);
}
 
开发者ID:xipki,项目名称:xipki,代码行数:7,代码来源:CmpResponder.java


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