Java 类org.bouncycastle.asn1.crmf.AttributeTypeAndValue 实例源码

项目:ipack    文件:CertificateRequestMessage.java   
/**
 * 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;
}
项目:ipack    文件:CertificateRequestMessage.java   
private AttributeTypeAndValue findControl(ASN1ObjectIdentifier type)
{
    if (controls == null)
    {
        return null;
    }

    AttributeTypeAndValue[] tAndVs = controls.toAttributeTypeAndValueArray();
    AttributeTypeAndValue found = null;

    for (int i = 0; i != tAndVs.length; i++)
    {
        if (tAndVs[i].getType().equals(type))
        {
            found = tAndVs[i];
            break;
        }
    }

    return found;
}
项目:gwt-crypto    文件:CertificateRequestMessage.java   
/**
 * 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;
}
项目:gwt-crypto    文件:CertificateRequestMessage.java   
private AttributeTypeAndValue findControl(ASN1ObjectIdentifier type)
{
    if (controls == null)
    {
        return null;
    }

    AttributeTypeAndValue[] tAndVs = controls.toAttributeTypeAndValueArray();
    AttributeTypeAndValue found = null;

    for (int i = 0; i != tAndVs.length; i++)
    {
        if (tAndVs[i].getType().equals(type))
        {
            found = tAndVs[i];
            break;
        }
    }

    return found;
}
项目:Aki-SSL    文件:CertificateRequestMessage.java   
/**
 * 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;
}
项目:Aki-SSL    文件:CertificateRequestMessage.java   
private AttributeTypeAndValue findControl(ASN1ObjectIdentifier type)
{
    if (controls == null)
    {
        return null;
    }

    AttributeTypeAndValue[] tAndVs = controls.toAttributeTypeAndValueArray();
    AttributeTypeAndValue found = null;

    for (int i = 0; i != tAndVs.length; i++)
    {
        if (tAndVs[i].getType().equals(type))
        {
            found = tAndVs[i];
            break;
        }
    }

    return found;
}
项目:irma_future_id    文件:CertificateRequestMessage.java   
/**
 * 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;
}
项目:irma_future_id    文件:CertificateRequestMessage.java   
private AttributeTypeAndValue findControl(ASN1ObjectIdentifier type)
{
    if (controls == null)
    {
        return null;
    }

    AttributeTypeAndValue[] tAndVs = controls.toAttributeTypeAndValueArray();
    AttributeTypeAndValue found = null;

    for (int i = 0; i != tAndVs.length; i++)
    {
        if (tAndVs[i].getType().equals(type))
        {
            found = tAndVs[i];
            break;
        }
    }

    return found;
}
项目:irma_future_id    文件:CertificateRequestMessage.java   
/**
 * 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;
}
项目:irma_future_id    文件:CertificateRequestMessage.java   
private AttributeTypeAndValue findControl(ASN1ObjectIdentifier type)
{
    if (controls == null)
    {
        return null;
    }

    AttributeTypeAndValue[] tAndVs = controls.toAttributeTypeAndValueArray();
    AttributeTypeAndValue found = null;

    for (int i = 0; i != tAndVs.length; i++)
    {
        if (tAndVs[i].getType().equals(type))
        {
            found = tAndVs[i];
            break;
        }
    }

    return found;
}
项目:bc-java    文件:CertificateRequestMessage.java   
/**
 * 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;
}
项目:bc-java    文件:CertificateRequestMessage.java   
private AttributeTypeAndValue findControl(ASN1ObjectIdentifier type)
{
    if (controls == null)
    {
        return null;
    }

    AttributeTypeAndValue[] tAndVs = controls.toAttributeTypeAndValueArray();
    AttributeTypeAndValue found = null;

    for (int i = 0; i != tAndVs.length; i++)
    {
        if (tAndVs[i].getType().equals(type))
        {
            found = tAndVs[i];
            break;
        }
    }

    return found;
}
项目:bc-java    文件:CertificateRequestMessage.java   
/**
 * 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;
}
项目:bc-java    文件:CertificateRequestMessage.java   
private AttributeTypeAndValue findControl(ASN1ObjectIdentifier type)
{
    if (controls == null)
    {
        return null;
    }

    AttributeTypeAndValue[] tAndVs = controls.toAttributeTypeAndValueArray();
    AttributeTypeAndValue found = null;

    for (int i = 0; i != tAndVs.length; i++)
    {
        if (tAndVs[i].getType().equals(type))
        {
            found = tAndVs[i];
            break;
        }
    }

    return found;
}
项目:xitk    文件:CmpUtil.java   
public static CmpUtf8Pairs extract(AttributeTypeAndValue[] atvs) {
    if (atvs == null) {
        return null;
    }

    for (AttributeTypeAndValue atv : atvs) {
        if (CMPObjectIdentifiers.regInfo_utf8Pairs.equals(atv.getType())) {
            String regInfoValue = ((ASN1String) atv.getValue()).getString();
            return new CmpUtf8Pairs(regInfoValue);
        }
    }

    return null;
}
项目:xitk    文件:CmpUtil.java   
public static AttributeTypeAndValue buildAttributeTypeAndValue(CmpUtf8Pairs utf8Pairs) {
    ParamUtil.requireNonNull("utf8Pairs", utf8Pairs);
    return new AttributeTypeAndValue(CMPObjectIdentifiers.regInfo_utf8Pairs,
            new DERUTF8String(utf8Pairs.encoded()));
}