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


Java ASN1GeneralizedTime.getInstance方法代码示例

本文整理汇总了Java中org.bouncycastle.asn1.ASN1GeneralizedTime.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java ASN1GeneralizedTime.getInstance方法的具体用法?Java ASN1GeneralizedTime.getInstance怎么用?Java ASN1GeneralizedTime.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bouncycastle.asn1.ASN1GeneralizedTime的用法示例。


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

示例1: getInstance

import org.bouncycastle.asn1.ASN1GeneralizedTime; //导入方法依赖的package包/类
public static DVCSTime getInstance(Object obj)
{
    if (obj instanceof DVCSTime)
    {
        return (DVCSTime)obj;
    }
    else if (obj instanceof ASN1GeneralizedTime)
    {
        return new DVCSTime(ASN1GeneralizedTime.getInstance(obj));
    }
    else if (obj != null)
    {
        return new DVCSTime(ContentInfo.getInstance(obj));
    }

    return null;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:DVCSTime.java

示例2: PrivateKeyUsagePeriod

import org.bouncycastle.asn1.ASN1GeneralizedTime; //导入方法依赖的package包/类
private PrivateKeyUsagePeriod(ASN1Sequence seq)
{
    Enumeration en = seq.getObjects();
    while (en.hasMoreElements())
    {
        ASN1TaggedObject tObj = (ASN1TaggedObject)en.nextElement();

        if (tObj.getTagNo() == 0)
        {
            _notBefore = ASN1GeneralizedTime.getInstance(tObj, false);
        }
        else if (tObj.getTagNo() == 1)
        {
            _notAfter = ASN1GeneralizedTime.getInstance(tObj, false);
        }
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:18,代码来源:PrivateKeyUsagePeriod.java

示例3: CrlID

import org.bouncycastle.asn1.ASN1GeneralizedTime; //导入方法依赖的package包/类
private CrlID(
    ASN1Sequence    seq)
{
    Enumeration    e = seq.getObjects();

    while (e.hasMoreElements())
    {
        ASN1TaggedObject    o = (ASN1TaggedObject)e.nextElement();

        switch (o.getTagNo())
        {
        case 0:
            crlUrl = DERIA5String.getInstance(o, true);
            break;
        case 1:
            crlNum = ASN1Integer.getInstance(o, true);
            break;
        case 2:
            crlTime = ASN1GeneralizedTime.getInstance(o, true);
            break;
        default:
            throw new IllegalArgumentException(
                    "unknown tag number: " + o.getTagNo());
        }
    }
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:27,代码来源:CrlID.java

示例4: PersonalData

import org.bouncycastle.asn1.ASN1GeneralizedTime; //导入方法依赖的package包/类
/**
 * Constructor from ASN1Sequence.
 * <p/>
 * The sequence is of type NameOrPseudonym:
 * <p/>
 * <pre>
 *     PersonalData ::= SEQUENCE {
 *       nameOrPseudonym NameOrPseudonym,
 *       nameDistinguisher [0] INTEGER OPTIONAL,
 *       dateOfBirth [1] GeneralizedTime OPTIONAL,
 *       placeOfBirth [2] DirectoryString OPTIONAL,
 *       gender [3] PrintableString OPTIONAL,
 *       postalAddress [4] DirectoryString OPTIONAL
 *       }
 * </pre>
 *
 * @param seq The ASN.1 sequence.
 */
private PersonalData(ASN1Sequence seq)
{
    if (seq.size() < 1)
    {
        throw new IllegalArgumentException("Bad sequence size: "
            + seq.size());
    }

    Enumeration e = seq.getObjects();

    nameOrPseudonym = NameOrPseudonym.getInstance(e.nextElement());

    while (e.hasMoreElements())
    {
        ASN1TaggedObject o = ASN1TaggedObject.getInstance(e.nextElement());
        int tag = o.getTagNo();
        switch (tag)
        {
            case 0:
                nameDistinguisher = ASN1Integer.getInstance(o, false).getValue();
                break;
            case 1:
                dateOfBirth = ASN1GeneralizedTime.getInstance(o, false);
                break;
            case 2:
                placeOfBirth = DirectoryString.getInstance(o, true);
                break;
            case 3:
                gender = DERPrintableString.getInstance(o, false).getString();
                break;
            case 4:
                postalAddress = DirectoryString.getInstance(o, true);
                break;
            default:
                throw new IllegalArgumentException("Bad tag number: " + o.getTagNo());
        }
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:57,代码来源:PersonalData.java

示例5: AttCertValidityPeriod

import org.bouncycastle.asn1.ASN1GeneralizedTime; //导入方法依赖的package包/类
private AttCertValidityPeriod(
    ASN1Sequence    seq)
{
    if (seq.size() != 2)
    {
        throw new IllegalArgumentException("Bad sequence size: "
                + seq.size());
    }

    notBeforeTime = ASN1GeneralizedTime.getInstance(seq.getObjectAt(0));
    notAfterTime = ASN1GeneralizedTime.getInstance(seq.getObjectAt(1));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:13,代码来源:AttCertValidityPeriod.java

示例6: getDateOfBirth

import org.bouncycastle.asn1.ASN1GeneralizedTime; //导入方法依赖的package包/类
public ASN1GeneralizedTime getDateOfBirth()
{
    if (declaration.getTagNo() != 2)
    {
        return null;
    }

    return ASN1GeneralizedTime.getInstance(declaration, false);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:10,代码来源:DeclarationOfMajority.java

示例7: setMessageTime

import org.bouncycastle.asn1.ASN1GeneralizedTime; //导入方法依赖的package包/类
/**
 * @deprecated use ASN1GeneralizedTime
 */
public PKIHeaderBuilder setMessageTime(DERGeneralizedTime time)
{
    messageTime = ASN1GeneralizedTime.getInstance(time);

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

示例8: RevAnnContent

import org.bouncycastle.asn1.ASN1GeneralizedTime; //导入方法依赖的package包/类
private RevAnnContent(ASN1Sequence seq)
{
    status = PKIStatus.getInstance(seq.getObjectAt(0));
    certId = CertId.getInstance(seq.getObjectAt(1));
    willBeRevokedAt = ASN1GeneralizedTime.getInstance(seq.getObjectAt(2));
    badSinceDate = ASN1GeneralizedTime.getInstance(seq.getObjectAt(3));

    if (seq.size() > 4)
    {
        crlDetails = Extensions.getInstance(seq.getObjectAt(4));
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:13,代码来源:RevAnnContent.java

示例9: ResponseData

import org.bouncycastle.asn1.ASN1GeneralizedTime; //导入方法依赖的package包/类
/**
 * @deprecated use method taking Extensions
 * @param responderID
 * @param producedAt
 * @param responses
 * @param responseExtensions
 */
public ResponseData(
    ResponderID         responderID,
    DERGeneralizedTime  producedAt,
    ASN1Sequence        responses,
    X509Extensions responseExtensions)
{
    this(V1, responderID, ASN1GeneralizedTime.getInstance(producedAt), responses, Extensions.getInstance(responseExtensions));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:16,代码来源:ResponseData.java

示例10: RevokedInfo

import org.bouncycastle.asn1.ASN1GeneralizedTime; //导入方法依赖的package包/类
private RevokedInfo(
    ASN1Sequence    seq)
{
    this.revocationTime = ASN1GeneralizedTime.getInstance(seq.getObjectAt(0));

    if (seq.size() > 1)
    {
        this.revocationReason = CRLReason.getInstance(DEREnumerated.getInstance(
                            (ASN1TaggedObject)seq.getObjectAt(1), true));
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:12,代码来源:RevokedInfo.java

示例11: SingleResponse

import org.bouncycastle.asn1.ASN1GeneralizedTime; //导入方法依赖的package包/类
/**
 * @deprecated use method taking ASN1GeneralizedTime and Extensions
 * @param certID
 * @param certStatus
 * @param thisUpdate
 * @param nextUpdate
 * @param singleExtensions
 */
public SingleResponse(
    CertID              certID,
    CertStatus          certStatus,
    DERGeneralizedTime thisUpdate,
    DERGeneralizedTime nextUpdate,
    Extensions          singleExtensions)
{
    this(certID, certStatus, ASN1GeneralizedTime.getInstance(thisUpdate), ASN1GeneralizedTime.getInstance(nextUpdate), Extensions.getInstance(singleExtensions));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:SingleResponse.java

示例12: PersonalData

import org.bouncycastle.asn1.ASN1GeneralizedTime; //导入方法依赖的package包/类
/**
 * Constructor from ASN1Sequence.
 * <p>
 * The sequence is of type NameOrPseudonym:
 * <pre>
 *     PersonalData ::= SEQUENCE {
 *       nameOrPseudonym NameOrPseudonym,
 *       nameDistinguisher [0] INTEGER OPTIONAL,
 *       dateOfBirth [1] GeneralizedTime OPTIONAL,
 *       placeOfBirth [2] DirectoryString OPTIONAL,
 *       gender [3] PrintableString OPTIONAL,
 *       postalAddress [4] DirectoryString OPTIONAL
 *       }
 * </pre>
 * </p>
 * @param seq The ASN.1 sequence.
 */
private PersonalData(ASN1Sequence seq)
{
    if (seq.size() < 1)
    {
        throw new IllegalArgumentException("Bad sequence size: "
            + seq.size());
    }

    Enumeration e = seq.getObjects();

    nameOrPseudonym = NameOrPseudonym.getInstance(e.nextElement());

    while (e.hasMoreElements())
    {
        ASN1TaggedObject o = ASN1TaggedObject.getInstance(e.nextElement());
        int tag = o.getTagNo();
        switch (tag)
        {
            case 0:
                nameDistinguisher = ASN1Integer.getInstance(o, false).getValue();
                break;
            case 1:
                dateOfBirth = ASN1GeneralizedTime.getInstance(o, false);
                break;
            case 2:
                placeOfBirth = DirectoryString.getInstance(o, true);
                break;
            case 3:
                gender = DERPrintableString.getInstance(o, false).getString();
                break;
            case 4:
                postalAddress = DirectoryString.getInstance(o, true);
                break;
            default:
                throw new IllegalArgumentException("Bad tag number: " + o.getTagNo());
        }
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:56,代码来源:PersonalData.java

示例13: SingleResponse

import org.bouncycastle.asn1.ASN1GeneralizedTime; //导入方法依赖的package包/类
private SingleResponse(
    ASN1Sequence    seq)
{
    this.certID = CertID.getInstance(seq.getObjectAt(0));
    this.certStatus = CertStatus.getInstance(seq.getObjectAt(1));
    this.thisUpdate = ASN1GeneralizedTime.getInstance(seq.getObjectAt(2));

    if (seq.size() > 4)
    {
        this.nextUpdate = ASN1GeneralizedTime.getInstance(
                            (ASN1TaggedObject)seq.getObjectAt(3), true);
        this.singleExtensions = Extensions.getInstance(
                            (ASN1TaggedObject)seq.getObjectAt(4), true);
    }
    else if (seq.size() > 3)
    {
        ASN1TaggedObject    o = (ASN1TaggedObject)seq.getObjectAt(3);

        if (o.getTagNo() == 0)
        {
            this.nextUpdate = ASN1GeneralizedTime.getInstance(o, true);
        }
        else
        {
            this.singleExtensions = Extensions.getInstance(o, true);
        }
    }
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:29,代码来源:SingleResponse.java

示例14: RecipientKeyIdentifier

import org.bouncycastle.asn1.ASN1GeneralizedTime; //导入方法依赖的package包/类
/**
 * @deprecated use getInstance()
 */
public RecipientKeyIdentifier(
    ASN1Sequence seq)
{
    subjectKeyIdentifier = ASN1OctetString.getInstance(
                                                seq.getObjectAt(0));
    
    switch(seq.size())
    {
    case 1:
        break;
    case 2:
        if (seq.getObjectAt(1) instanceof ASN1GeneralizedTime)
        {
            date = ASN1GeneralizedTime.getInstance(seq.getObjectAt(1));
        }
        else
        {
            other = OtherKeyAttribute.getInstance(seq.getObjectAt(2));
        }
        break;
    case 3:
        date  = ASN1GeneralizedTime.getInstance(seq.getObjectAt(1));
        other = OtherKeyAttribute.getInstance(seq.getObjectAt(2));
        break;
    default:
        throw new IllegalArgumentException("Invalid RecipientKeyIdentifier");
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:32,代码来源:RecipientKeyIdentifier.java

示例15: ResponseData

import org.bouncycastle.asn1.ASN1GeneralizedTime; //导入方法依赖的package包/类
private ResponseData(
    ASN1Sequence    seq)
{
    int index = 0;

    if (seq.getObjectAt(0) instanceof ASN1TaggedObject)
    {
        ASN1TaggedObject    o = (ASN1TaggedObject)seq.getObjectAt(0);

        if (o.getTagNo() == 0)
        {
            this.versionPresent = true;
            this.version = ASN1Integer.getInstance(
                            (ASN1TaggedObject)seq.getObjectAt(0), true);
            index++;
        }
        else
        {
            this.version = V1;
        }
    }
    else
    {
        this.version = V1;
    }

    this.responderID = ResponderID.getInstance(seq.getObjectAt(index++));
    this.producedAt = ASN1GeneralizedTime.getInstance(seq.getObjectAt(index++));
    this.responses = (ASN1Sequence)seq.getObjectAt(index++);

    if (seq.size() > index)
    {
        this.responseExtensions = Extensions.getInstance(
                            (ASN1TaggedObject)seq.getObjectAt(index), true);
    }
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:37,代码来源:ResponseData.java


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