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


Java Strings.lineSeparator方法代码示例

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


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

示例1: toString

import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
public String toString()
{
    StringBuffer buf = new StringBuffer();
    String       sep = Strings.lineSeparator();

    buf.append("CRLDistPoint:");
    buf.append(sep);
    DistributionPoint dp[] = getDistributionPoints();
    for (int i = 0; i != dp.length; i++)
    {
        buf.append("    ");
        buf.append(dp[i]);
        buf.append(sep);
    }
    return buf.toString();
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:17,代码来源:CRLDistPoint.java

示例2: toString

import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
public String toString()
{
    String       sep = Strings.lineSeparator();
    StringBuffer buf = new StringBuffer();
    buf.append("DistributionPoint: [");
    buf.append(sep);
    if (distributionPoint != null)
    {
        appendObject(buf, sep, "distributionPoint", distributionPoint.toString());
    }
    if (reasons != null)
    {
        appendObject(buf, sep, "reasons", reasons.toString());
    }
    if (cRLIssuer != null)
    {
        appendObject(buf, sep, "cRLIssuer", cRLIssuer.toString());
    }
    buf.append("]");
    buf.append(sep);
    return buf.toString();
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:23,代码来源:DistributionPoint.java

示例3: toString

import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
public String toString()
{
    StringBuffer    buf = new StringBuffer();
    String          nl = Strings.lineSeparator();

    buf.append("RSA Private CRT Key").append(nl);
    buf.append("            modulus: ").append(this.getModulus().toString(16)).append(nl);
    buf.append("    public exponent: ").append(this.getPublicExponent().toString(16)).append(nl);
    buf.append("   private exponent: ").append(this.getPrivateExponent().toString(16)).append(nl);
    buf.append("             primeP: ").append(this.getPrimeP().toString(16)).append(nl);
    buf.append("             primeQ: ").append(this.getPrimeQ().toString(16)).append(nl);
    buf.append("     primeExponentP: ").append(this.getPrimeExponentP().toString(16)).append(nl);
    buf.append("     primeExponentQ: ").append(this.getPrimeExponentQ().toString(16)).append(nl);
    buf.append("     crtCoefficient: ").append(this.getCrtCoefficient().toString(16)).append(nl);

    return buf.toString();
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:18,代码来源:BCRSAPrivateCrtKey.java

示例4: toString

import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
public String toString()
{
    String       sep = Strings.lineSeparator();
    StringBuffer buf = new StringBuffer();
    buf.append("DistributionPointName: [");
    buf.append(sep);
    if (type == FULL_NAME)
    {
        appendObject(buf, sep, "fullName", name.toString());
    }
    else
    {
        appendObject(buf, sep, "nameRelativeToCRLIssuer", name.toString());
    }
    buf.append("]");
    buf.append(sep);
    return buf.toString();
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:19,代码来源:DistributionPointName.java

示例5: toString

import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
public String toString()
{
    StringBuffer buf = new StringBuffer();
    String nl = Strings.lineSeparator();

    buf.append("EC Public Key").append(nl);
    buf.append("            X: ").append(this.q.getAffineXCoord().toBigInteger().toString(16)).append(nl);
    buf.append("            Y: ").append(this.q.getAffineYCoord().toBigInteger().toString(16)).append(nl);

    return buf.toString();
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:12,代码来源:BCDSTU4145PublicKey.java

示例6: dumpBinaryDataAsString

import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
private static String dumpBinaryDataAsString(String indent, byte[] bytes)
{
    String nl = Strings.lineSeparator();
    StringBuffer buf = new StringBuffer();

    indent += TAB;
    
    buf.append(nl);
    for (int i = 0; i < bytes.length; i += SAMPLE_SIZE)
    {
        if (bytes.length - i > SAMPLE_SIZE)
        {
            buf.append(indent);
            buf.append(new String(Hex.encode(bytes, i, SAMPLE_SIZE)));
            buf.append(TAB);
            buf.append(calculateAscString(bytes, i, SAMPLE_SIZE));
            buf.append(nl);
        }
        else
        {
            buf.append(indent);
            buf.append(new String(Hex.encode(bytes, i, bytes.length - i)));
            for (int j = bytes.length - i; j != SAMPLE_SIZE; j++)
            {
                buf.append("  ");
            }
            buf.append(TAB);
            buf.append(calculateAscString(bytes, i, bytes.length - i));
            buf.append(nl);
        }
    }
    
    return buf.toString();
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:35,代码来源:ASN1Dump.java

示例7: toString

import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
public String toString()
{
    StringBuffer    buf = new StringBuffer();
    String          nl = Strings.lineSeparator();

    buf.append("RSA Public Key").append(nl);
    buf.append("            modulus: ").append(this.getModulus().toString(16)).append(nl);
    buf.append("    public exponent: ").append(this.getPublicExponent().toString(16)).append(nl);

    return buf.toString();
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:12,代码来源:BCRSAPublicKey.java

示例8: toString

import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
public String toString()
{
    StringBuffer buf = new StringBuffer();
    String nl = Strings.lineSeparator();

    buf.append("EC Private Key").append(nl);
    buf.append("             S: ").append(this.d.toString(16)).append(nl);

    return buf.toString();

}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:12,代码来源:BCECGOST3410PrivateKey.java

示例9: toString

import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
public String toString()
{
    StringBuffer    buf = new StringBuffer();
    String          nl = Strings.lineSeparator();

    buf.append("EC Private Key").append(nl);
    buf.append("             S: ").append(this.d.toString(16)).append(nl);

    return buf.toString();

}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:12,代码来源:JCEECPrivateKey.java

示例10: toString

import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
public String toString()
{
    StringBuffer    buf = new StringBuffer();
    String          nl = Strings.lineSeparator();

    buf.append("EC Public Key").append(nl);
    buf.append("            X: ").append(this.q.getAffineXCoord().toBigInteger().toString(16)).append(nl);
    buf.append("            Y: ").append(this.q.getAffineYCoord().toBigInteger().toString(16)).append(nl);

    return buf.toString();

}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:13,代码来源:JCEECPublicKey.java

示例11: perform

import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
public TestResult perform()
{
    BigInteger              r = new BigInteger("64a8856628e5669d85f62cd763dd4a99bc56d33dc0e1859122855d141e9e4774",16);
    BigInteger              s = new BigInteger("319ebac97092b288d469a4b988248794f60c865bc97858d9a3135c6d1a1bf2dd",16);
    GOST3410ParametersGenerator  pGen = new GOST3410ParametersGenerator();

    pGen.init(1024, 2, init_random);

    GOST3410Parameters           params = pGen.generateParameters();

    if (!pValue.equals(params.getP()) || !qValue.equals(params.getQ()))
    {
        return new SimpleTestResult(false, getName() + ": p or q wrong");
    }

    GOST3410KeyPairGenerator         GOST3410KeyGen = new GOST3410KeyPairGenerator();
    GOST3410KeyGenerationParameters  genParam = new GOST3410KeyGenerationParameters(keyRandom, params);

    GOST3410KeyGen.init(genParam);

    AsymmetricCipherKeyPair  pair = GOST3410KeyGen.generateKeyPair();

    ParametersWithRandom param = new ParametersWithRandom(pair.getPrivate(), random);

    GOST3410Signer GOST3410 = new GOST3410Signer();

    GOST3410.init(true, param);

    BigInteger[] sig = GOST3410.generateSignature(hashmessage);

    if (!r.equals(sig[0]))
    {
        return new SimpleTestResult(false, getName()
            + ": r component wrong." + Strings.lineSeparator()
            + " expecting: " + r.toString(16) + Strings.lineSeparator()
            + " got      : " + sig[0].toString(16));
    }

    if (!s.equals(sig[1]))
    {
        return new SimpleTestResult(false, getName()
            + ": s component wrong." + Strings.lineSeparator()
            + " expecting: " + s.toString(16) + Strings.lineSeparator()
            + " got      : " + sig[1].toString(16));
    }

    GOST3410.init(false, pair.getPublic());

    if (GOST3410.verifySignature(hashmessage, sig[0], sig[1]))
    {
        return new SimpleTestResult(true, getName() + ": Okay");
    }
    else
    {
        return new SimpleTestResult(false, getName() + ": verification fails");
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:58,代码来源:GOST3410Test.java

示例12: toString

import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
public String toString()
{
    StringBuffer buf = new StringBuffer();
    String nl = Strings.lineSeparator();

    buf.append("      userCertificate: ").append(this.getSerialNumber()).append(nl);
    buf.append("       revocationDate: ").append(this.getRevocationDate()).append(nl);
    buf.append("       certificateIssuer: ").append(this.getCertificateIssuer()).append(nl);

    Extensions extensions = c.getExtensions();

    if (extensions != null)
    {
        Enumeration e = extensions.oids();
        if (e.hasMoreElements())
        {
            buf.append("   crlEntryExtensions:").append(nl);

            while (e.hasMoreElements())
            {
                ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier)e.nextElement();
                Extension ext = extensions.getExtension(oid);
                if (ext.getExtnValue() != null)
                {
                    byte[]                  octs = ext.getExtnValue().getOctets();
                    ASN1InputStream dIn = new ASN1InputStream(octs);
                    buf.append("                       critical(").append(ext.isCritical()).append(") ");
                    try
                    {
                        if (oid.equals(X509Extension.reasonCode))
                        {
                            buf.append(CRLReason.getInstance(ASN1Enumerated.getInstance(dIn.readObject()))).append(nl);
                        }
                        else if (oid.equals(X509Extension.certificateIssuer))
                        {
                            buf.append("Certificate issuer: ").append(GeneralNames.getInstance(dIn.readObject())).append(nl);
                        }
                        else 
                        {
                            buf.append(oid.getId());
                            buf.append(" value = ").append(ASN1Dump.dumpAsString(dIn.readObject())).append(nl);
                        }
                    }
                    catch (Exception ex)
                    {
                        buf.append(oid.getId());
                        buf.append(" value = ").append("*****").append(nl);
                    }
                }
                else
                {
                    buf.append(nl);
                }
            }
        }
    }

    return buf.toString();
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:60,代码来源:X509CRLEntryObject.java


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