⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 displaytext.java

📁 进行与数字证书相关开发必须的java源码
💻 JAVA
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   DisplayText.java

package jit.asn1.x509;

import jit.asn1.*;

public class DisplayText extends ASN1Encodable
{

    public static final int CONTENT_TYPE_IA5STRING = 0;
    public static final int CONTENT_TYPE_BMPSTRING = 1;
    public static final int CONTENT_TYPE_UTF8STRING = 2;
    public static final int CONTENT_TYPE_VISIBLESTRING = 3;
    public static final int DISPLAY_TEXT_MAXIMUM_SIZE = 200;
    int contentType;
    DERString contents;

    public DisplayText(int type, String text)
    {
        if(text.length() > 200)
            text = text.substring(0, 200);
        contentType = type;
        switch(type)
        {
        case 0: // '\0'
            contents = new DERIA5String(text);
            break;

        case 2: // '\002'
            contents = new DERUTF8String(text);
            break;

        case 3: // '\003'
            contents = new DERVisibleString(text);
            break;

        case 1: // '\001'
            contents = new DERBMPString(text);
            break;

        default:
            contents = new DERUTF8String(text);
            break;
        }
    }

    public DisplayText(String text)
    {
        if(text.length() > 200)
            text = text.substring(0, 200);
        contentType = 2;
        contents = new DERUTF8String(text);
    }

    public DisplayText(DERString de)
    {
        contents = de;
    }

    public static DisplayText getInstance(Object de)
    {
        if(de instanceof DERString)
            return new DisplayText((DERString)de);
        if(de instanceof DisplayText)
            return (DisplayText)de;
        else
            throw new IllegalArgumentException("illegal object in getInstance");
    }

    public DERObject toASN1Object()
    {
        return (DERObject)contents;
    }

    public String getString()
    {
        return contents.getString();
    }

    static 
    {
        CONTENT_TYPE_IA5STRING = 0;
        CONTENT_TYPE_BMPSTRING = 1;
        CONTENT_TYPE_UTF8STRING = 2;
        CONTENT_TYPE_VISIBLESTRING = 3;
        DISPLAY_TEXT_MAXIMUM_SIZE = 200;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -