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


Java PolicyInformation类代码示例

本文整理汇总了Java中org.bouncycastle.asn1.x509.PolicyInformation的典型用法代码示例。如果您正苦于以下问题:Java PolicyInformation类的具体用法?Java PolicyInformation怎么用?Java PolicyInformation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PolicyInformation类属于org.bouncycastle.asn1.x509包,在下文中一共展示了PolicyInformation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPolicies

import org.bouncycastle.asn1.x509.PolicyInformation; //导入依赖的package包/类
public PolicyInformation[] getPolicies()
{
    if (policies == null)
    {
        return null;
    }

    PolicyInformation[] ps = new PolicyInformation[policies.size()];

    for (int i = 0; i != policies.size(); i++)
    {
        ps[i] = PolicyInformation.getInstance(policies.getObjectAt(i));
    }

    return ps;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:17,代码来源:OtherSigningCertificate.java

示例2: getPolicies

import org.bouncycastle.asn1.x509.PolicyInformation; //导入依赖的package包/类
public PolicyInformation[] getPolicies()
{
    if (policies == null)
    {
        return null;
    }
    
    PolicyInformation[] ps = new PolicyInformation[policies.size()];
    
    for (int i = 0; i != policies.size(); i++)
    {
        ps[i] = PolicyInformation.getInstance(policies.getObjectAt(i));
    }
    
    return ps;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:17,代码来源:SigningCertificate.java

示例3: SigningCertificateV2

import org.bouncycastle.asn1.x509.PolicyInformation; //导入依赖的package包/类
public SigningCertificateV2(
    ESSCertIDv2[] certs,
    PolicyInformation[] policies)
{
    ASN1EncodableVector v = new ASN1EncodableVector();
    for (int i=0; i < certs.length; i++)
    {
        v.add(certs[i]);
    }
    this.certs = new DERSequence(v);

    if (policies != null)
    {
        v = new ASN1EncodableVector();
        for (int i=0; i < policies.length; i++)
        {
            v.add(policies[i]);
        }
        this.policies = new DERSequence(v);
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:22,代码来源:SigningCertificateV2.java

示例4: okPressed

import org.bouncycastle.asn1.x509.PolicyInformation; //导入依赖的package包/类
private void okPressed() {
	List<PolicyInformation> policyInformation = jpiCertificatePolicies.getPolicyInformation();

	if (policyInformation.size() == 0) {
		JOptionPane.showMessageDialog(this, res.getString("DCertificatePolicies.ValueReq.message"), getTitle(),
				JOptionPane.WARNING_MESSAGE);
		return;
	}



	CertificatePolicies certificatePolicies = new CertificatePolicies(policyInformation.toArray(
			new PolicyInformation[policyInformation.size()]));

	try {
		value = certificatePolicies.getEncoded(ASN1Encoding.DER);
	} catch (IOException ex) {
		DError dError = new DError(this, ex);
		dError.setLocationRelativeTo(this);
		dError.setVisible(true);
		return;
	}

	closeDialog();
}
 
开发者ID:kaikramer,项目名称:keystore-explorer,代码行数:26,代码来源:DCertificatePolicies.java

示例5: getTableCellRendererComponent

import org.bouncycastle.asn1.x509.PolicyInformation; //导入依赖的package包/类
/**
 * Returns the rendered cell.
 *
 * @param jtPolicyInformation
 *            The JTable
 * @param value
 *            The value to assign to the cell
 * @param isSelected
 *            True if cell is selected
 * @param row
 *            The row of the cell to render
 * @param col
 *            The column of the cell to render
 * @param hasFocus
 *            If true, render cell appropriately
 * @return The renderered cell
 */
@Override
public Component getTableCellRendererComponent(JTable jtPolicyInformation, Object value, boolean isSelected,
		boolean hasFocus, int row, int col) {
	JLabel cell = (JLabel) super.getTableCellRendererComponent(jtPolicyInformation, value, isSelected, hasFocus,
			row, col);

	PolicyInformation policyInformation = (PolicyInformation) value;

	try {
		String policyInformationStr = PolicyInformationUtil.toString(policyInformation);
		cell.setText(policyInformationStr);
		cell.setToolTipText(policyInformationStr);
	} catch (IOException ex) {
		throw new RuntimeException(ex); // We build this data so should not
		// happen
	}

	cell.setHorizontalAlignment(LEFT);
	cell.setBorder(new EmptyBorder(0, 5, 0, 5));

	return cell;
}
 
开发者ID:kaikramer,项目名称:keystore-explorer,代码行数:40,代码来源:PolicyInformationTableCellRend.java

示例6: populate

import org.bouncycastle.asn1.x509.PolicyInformation; //导入依赖的package包/类
private void populate(PolicyInformation policyInformation) throws IOException {
	if (policyInformation != null) {
		joiPolicyIdentifier.setObjectId(policyInformation.getPolicyIdentifier());

		ASN1Sequence policyQualifierInfoSeq = policyInformation.getPolicyQualifiers();

		if (policyQualifierInfoSeq != null) {
			List<PolicyQualifierInfo> policyQualifierInfo = new ArrayList<PolicyQualifierInfo>();

			for (int i = 0; i < policyQualifierInfoSeq.size(); i++) {
				PolicyQualifierInfo policyQualInfo = PolicyQualifierInfo.getInstance(
						policyQualifierInfoSeq.getObjectAt(i));
				policyQualifierInfo.add(policyQualInfo);
			}

			jpqPolicyQualifiers.setPolicyQualifierInfo(policyQualifierInfo);
		}
	}
}
 
开发者ID:kaikramer,项目名称:keystore-explorer,代码行数:20,代码来源:DPolicyInformationChooser.java

示例7: load

import org.bouncycastle.asn1.x509.PolicyInformation; //导入依赖的package包/类
/**
 * Load the PolicyInformationTableModel with policy information.
 *
 * @param policyInformation
 *            The policy information
 */
public void load(List<PolicyInformation> policyInformation) {
	PolicyInformation[] policyInformationArray = policyInformation.toArray(new PolicyInformation[policyInformation
	                                                                                             .size()]);
	Arrays.sort(policyInformationArray, new PolicyInformationComparator());

	data = new Object[policyInformation.size()][1];

	int i = 0;
	for (PolicyInformation policyInfo : policyInformationArray) {
		data[i][0] = policyInfo;
		i++;
	}

	fireTableDataChanged();
}
 
开发者ID:kaikramer,项目名称:keystore-explorer,代码行数:22,代码来源:PolicyInformationTableModel.java

示例8: createCertificatePolicies

import org.bouncycastle.asn1.x509.PolicyInformation; //导入依赖的package包/类
public static org.bouncycastle.asn1.x509.CertificatePolicies createCertificatePolicies(
        List<CertificatePolicyInformation> policyInfos) throws CertprofileException {
    ParamUtil.requireNonEmpty("policyInfos", policyInfos);

    int size = policyInfos.size();
    PolicyInformation[] infos = new PolicyInformation[size];

    int idx = 0;
    for (CertificatePolicyInformation policyInfo : policyInfos) {
        String policyId = policyInfo.certPolicyId();
        List<CertificatePolicyQualifier> qualifiers = policyInfo.qualifiers();

        ASN1Sequence policyQualifiers = null;
        if (CollectionUtil.isNonEmpty(qualifiers)) {
            policyQualifiers = createPolicyQualifiers(qualifiers);
        }

        ASN1ObjectIdentifier policyOid = new ASN1ObjectIdentifier(policyId);
        infos[idx++] = (policyQualifiers == null) ? new PolicyInformation(policyOid)
                : new PolicyInformation(policyOid, policyQualifiers);
    }

    return new org.bouncycastle.asn1.x509.CertificatePolicies(infos);
}
 
开发者ID:xipki,项目名称:xipki,代码行数:25,代码来源:XmlX509CertprofileUtil.java

示例9: getCertificatePolicyId

import org.bouncycastle.asn1.x509.PolicyInformation; //导入依赖的package包/类
/**
 * Get a certificate policy ID from a certificate policies extension
 *
 * @param cert certificate containing the extension
 * @param pos position of the policy id, if several exist, the first is as pos 0
 * @return String with the certificate policy OID
 * @throws IOException if extension can not be parsed
 */
public static String getCertificatePolicyId(X509Certificate cert, int pos) throws IOException {
    byte[] extvalue = cert.getExtensionValue(X509Extensions.CertificatePolicies.getId());
    if (extvalue == null) {
        return null;
    }
    DEROctetString oct = (DEROctetString) (new ASN1InputStream(new ByteArrayInputStream(extvalue))
            .readObject());
    ASN1Sequence seq = (ASN1Sequence) new ASN1InputStream(new ByteArrayInputStream(oct.getOctets()))
            .readObject();

    // Check the size so we don't ArrayIndexOutOfBounds
    if (seq.size() < (pos + 1)) {
        return null;
    }
    PolicyInformation pol = new PolicyInformation((ASN1Sequence) seq.getObjectAt(pos));
    String id = pol.getPolicyIdentifier().getId();
    return id;
}
 
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:27,代码来源:CertTools.java

示例10: setRequestPolicy

import org.bouncycastle.asn1.x509.PolicyInformation; //导入依赖的package包/类
public void setRequestPolicy(PolicyInformation requestPolicy)
{
    if (initialInfo != null)
    {
        throw new IllegalStateException("cannot change request policy in existing DVCSRequestInformation");
    }

    this.requestPolicy = requestPolicy;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:10,代码来源:DVCSRequestInformationBuilder.java

示例11: PathProcInput

import org.bouncycastle.asn1.x509.PolicyInformation; //导入依赖的package包/类
public PathProcInput(PolicyInformation[] acceptablePolicySet, boolean inhibitPolicyMapping, boolean explicitPolicyReqd, boolean inhibitAnyPolicy)
{
    this.acceptablePolicySet = acceptablePolicySet;
    this.inhibitPolicyMapping = inhibitPolicyMapping;
    this.explicitPolicyReqd = explicitPolicyReqd;
    this.inhibitAnyPolicy = inhibitAnyPolicy;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:8,代码来源:PathProcInput.java

示例12: fromSequence

import org.bouncycastle.asn1.x509.PolicyInformation; //导入依赖的package包/类
private static PolicyInformation[] fromSequence(ASN1Sequence seq)
{
    PolicyInformation[] tmp = new PolicyInformation[seq.size()];

    for (int i = 0; i != tmp.length; i++)
    {
        tmp[i] = PolicyInformation.getInstance(seq.getObjectAt(i));
    }

    return tmp;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:12,代码来源:PathProcInput.java

示例13: getPolicies

import org.bouncycastle.asn1.x509.PolicyInformation; //导入依赖的package包/类
public PolicyInformation[] getPolicies()
{
    if (policies == null)
    {
        return null;
    }

    PolicyInformation[] policyInformations = new PolicyInformation[policies.size()];
    for (int i = 0; i != policies.size(); i++)
    {
        policyInformations[i] = PolicyInformation.getInstance(policies.getObjectAt(i));
    }
    return policyInformations;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:15,代码来源:SigningCertificateV2.java

示例14: getRequestPolicy

import org.bouncycastle.asn1.x509.PolicyInformation; //导入依赖的package包/类
/**
 * Get policy, under which the validation is requested.
 *
 * @return policy identifier or null, if any policy is acceptable.
 */
public PolicyInformation getRequestPolicy()
{
    if (data.getRequestPolicy() != null)
    {
        return data.getRequestPolicy();
    }
    return null;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:14,代码来源:DVCSRequestInfo.java

示例15: setCertificatePoliciesExtension

import org.bouncycastle.asn1.x509.PolicyInformation; //导入依赖的package包/类
static void setCertificatePoliciesExtension(X509v3CertificateBuilder certificateBuilder, boolean isCritical,
                                            boolean anyPolicy, String cpsURI) throws IOException {
    if (anyPolicy) {
        PolicyQualifierInfo policyQualifierInfo = new PolicyQualifierInfo(cpsURI);
        PolicyInformation policyInformation = new PolicyInformation(PolicyQualifierId.id_qt_cps,
                new DERSequence(policyQualifierInfo));
        CertificatePolicies certificatePolicies = new CertificatePolicies(policyInformation);
        certificateBuilder.addExtension(Extension.certificatePolicies, isCritical, certificatePolicies);
    }
}
 
开发者ID:stevanmilic,项目名称:X509-certificate-manager,代码行数:11,代码来源:CertificateHelper.java


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