Java 类org.bouncycastle.asn1.oiw.ElGamalParameter 实例源码

项目:Aki-SSL    文件:JCEElGamalPublicKey.java   
JCEElGamalPublicKey(
    SubjectPublicKeyInfo    info)
{
    ElGamalParameter        params = ElGamalParameter.getInstance(info.getAlgorithm().getParameters());
    ASN1Integer              derY = null;

    try
    {
        derY = (ASN1Integer)info.parsePublicKey();
    }
    catch (IOException e)
    {
        throw new IllegalArgumentException("invalid info structure in DSA public key");
    }

    this.y = derY.getValue();
    this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG());
}
项目:Aki-SSL    文件:BCElGamalPublicKey.java   
BCElGamalPublicKey(
    SubjectPublicKeyInfo info)
{
    ElGamalParameter        params = ElGamalParameter.getInstance(info.getAlgorithm().getParameters());
    ASN1Integer              derY = null;

    try
    {
        derY = (ASN1Integer)info.parsePublicKey();
    }
    catch (IOException e)
    {
        throw new IllegalArgumentException("invalid info structure in DSA public key");
    }

    this.y = derY.getValue();
    this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG());
}
项目:ipack    文件:JCEElGamalPrivateKey.java   
JCEElGamalPrivateKey(
    PrivateKeyInfo  info)
    throws IOException
{
    ElGamalParameter     params = new ElGamalParameter((ASN1Sequence)info.getAlgorithmId().getParameters());
    DERInteger      derX = ASN1Integer.getInstance(info.parsePrivateKey());

    this.x = derX.getValue();
    this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG());
}
项目:ipack    文件:BCElGamalPrivateKey.java   
BCElGamalPrivateKey(
    PrivateKeyInfo info)
    throws IOException
{
    ElGamalParameter     params = new ElGamalParameter((ASN1Sequence)info.getAlgorithmId().getParameters());
    DERInteger      derX = ASN1Integer.getInstance(info.parsePrivateKey());

    this.x = derX.getValue();
    this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG());
}
项目:ipack    文件:BCElGamalPrivateKey.java   
/**
 * Return a PKCS8 representation of the key. The sequence returned
 * represents a full PrivateKeyInfo object.
 *
 * @return a PKCS8 representation of the key.
 */
public byte[] getEncoded()
{
    try
    {
        PrivateKeyInfo          info = new PrivateKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new DERInteger(getX()));

        return info.getEncoded(ASN1Encoding.DER);
    }
    catch (IOException e)
    {
        return null;
    }
}
项目:ipack    文件:AlgorithmParametersSpi.java   
/**
 * Return the X.509 ASN.1 structure ElGamalParameter.
 * <p/>
 * <pre>
 *  ElGamalParameter ::= SEQUENCE {
 *                   prime INTEGER, -- p
 *                   base INTEGER, -- g}
 * </pre>
 */
protected byte[] engineGetEncoded()
{
    ElGamalParameter elP = new ElGamalParameter(currentSpec.getP(), currentSpec.getG());

    try
    {
        return elP.getEncoded(ASN1Encoding.DER);
    }
    catch (IOException e)
    {
        throw new RuntimeException("Error encoding ElGamalParameters");
    }
}
项目:ipack    文件:BCElGamalPublicKey.java   
public byte[] getEncoded()
{
    try
    {
        SubjectPublicKeyInfo    info = new SubjectPublicKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new DERInteger(y));

        return info.getEncoded(ASN1Encoding.DER);
    }
    catch (IOException e)
    {
        return null;
    }
}
项目:Aki-SSL    文件:JCEElGamalPrivateKey.java   
JCEElGamalPrivateKey(
    PrivateKeyInfo  info)
    throws IOException
{
    ElGamalParameter     params = ElGamalParameter.getInstance(info.getPrivateKeyAlgorithm().getParameters());
    ASN1Integer      derX = ASN1Integer.getInstance(info.parsePrivateKey());

    this.x = derX.getValue();
    this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG());
}
项目:Aki-SSL    文件:BCElGamalPrivateKey.java   
BCElGamalPrivateKey(
    PrivateKeyInfo info)
    throws IOException
{
    ElGamalParameter     params = ElGamalParameter.getInstance(info.getPrivateKeyAlgorithm().getParameters());
    ASN1Integer      derX = ASN1Integer.getInstance(info.parsePrivateKey());

    this.x = derX.getValue();
    this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG());
}
项目:Aki-SSL    文件:BCElGamalPrivateKey.java   
/**
 * Return a PKCS8 representation of the key. The sequence returned
 * represents a full PrivateKeyInfo object.
 *
 * @return a PKCS8 representation of the key.
 */
public byte[] getEncoded()
{
    try
    {
        PrivateKeyInfo          info = new PrivateKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new ASN1Integer(getX()));

        return info.getEncoded(ASN1Encoding.DER);
    }
    catch (IOException e)
    {
        return null;
    }
}
项目:Aki-SSL    文件:AlgorithmParametersSpi.java   
/**
 * Return the X.509 ASN.1 structure ElGamalParameter.
 * <pre>
 *  ElGamalParameter ::= SEQUENCE {
 *                   prime INTEGER, -- p
 *                   base INTEGER, -- g}
 * </pre>
 */
protected byte[] engineGetEncoded()
{
    ElGamalParameter elP = new ElGamalParameter(currentSpec.getP(), currentSpec.getG());

    try
    {
        return elP.getEncoded(ASN1Encoding.DER);
    }
    catch (IOException e)
    {
        throw new RuntimeException("Error encoding ElGamalParameters");
    }
}
项目:Aki-SSL    文件:BCElGamalPublicKey.java   
public byte[] getEncoded()
{
    try
    {
        SubjectPublicKeyInfo    info = new SubjectPublicKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new ASN1Integer(y));

        return info.getEncoded(ASN1Encoding.DER);
    }
    catch (IOException e)
    {
        return null;
    }
}
项目:CryptMeme    文件:JCEElGamalPrivateKey.java   
JCEElGamalPrivateKey(
    PrivateKeyInfo  info)
    throws IOException
{
    ElGamalParameter     params = new ElGamalParameter((ASN1Sequence)info.getAlgorithmId().getParameters());
    DERInteger      derX = ASN1Integer.getInstance(info.parsePrivateKey());

    this.x = derX.getValue();
    this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG());
}
项目:CryptMeme    文件:BCElGamalPrivateKey.java   
BCElGamalPrivateKey(
    PrivateKeyInfo info)
    throws IOException
{
    ElGamalParameter     params = new ElGamalParameter((ASN1Sequence)info.getAlgorithmId().getParameters());
    DERInteger      derX = ASN1Integer.getInstance(info.parsePrivateKey());

    this.x = derX.getValue();
    this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG());
}
项目:CryptMeme    文件:BCElGamalPrivateKey.java   
/**
 * Return a PKCS8 representation of the key. The sequence returned
 * represents a full PrivateKeyInfo object.
 *
 * @return a PKCS8 representation of the key.
 */
public byte[] getEncoded()
{
    try
    {
        PrivateKeyInfo          info = new PrivateKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new DERInteger(getX()));

        return info.getEncoded(ASN1Encoding.DER);
    }
    catch (IOException e)
    {
        return null;
    }
}
项目:CryptMeme    文件:AlgorithmParametersSpi.java   
/**
 * Return the X.509 ASN.1 structure ElGamalParameter.
 * <p/>
 * <pre>
 *  ElGamalParameter ::= SEQUENCE {
 *                   prime INTEGER, -- p
 *                   base INTEGER, -- g}
 * </pre>
 */
protected byte[] engineGetEncoded()
{
    ElGamalParameter elP = new ElGamalParameter(currentSpec.getP(), currentSpec.getG());

    try
    {
        return elP.getEncoded(ASN1Encoding.DER);
    }
    catch (IOException e)
    {
        throw new RuntimeException("Error encoding ElGamalParameters");
    }
}
项目:CryptMeme    文件:BCElGamalPublicKey.java   
public byte[] getEncoded()
{
    try
    {
        SubjectPublicKeyInfo    info = new SubjectPublicKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new DERInteger(y));

        return info.getEncoded(ASN1Encoding.DER);
    }
    catch (IOException e)
    {
        return null;
    }
}
项目:irma_future_id    文件:JCEElGamalPrivateKey.java   
JCEElGamalPrivateKey(
    PrivateKeyInfo  info)
    throws IOException
{
    ElGamalParameter     params = new ElGamalParameter((ASN1Sequence)info.getAlgorithmId().getParameters());
    DERInteger      derX = ASN1Integer.getInstance(info.parsePrivateKey());

    this.x = derX.getValue();
    this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG());
}
项目:irma_future_id    文件:BCElGamalPrivateKey.java   
BCElGamalPrivateKey(
    PrivateKeyInfo info)
    throws IOException
{
    ElGamalParameter     params = new ElGamalParameter((ASN1Sequence)info.getAlgorithmId().getParameters());
    DERInteger      derX = ASN1Integer.getInstance(info.parsePrivateKey());

    this.x = derX.getValue();
    this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG());
}
项目:irma_future_id    文件:BCElGamalPrivateKey.java   
/**
 * Return a PKCS8 representation of the key. The sequence returned
 * represents a full PrivateKeyInfo object.
 *
 * @return a PKCS8 representation of the key.
 */
public byte[] getEncoded()
{
    try
    {
        PrivateKeyInfo          info = new PrivateKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new DERInteger(getX()));

        return info.getEncoded(ASN1Encoding.DER);
    }
    catch (IOException e)
    {
        return null;
    }
}
项目:irma_future_id    文件:AlgorithmParametersSpi.java   
/**
 * Return the X.509 ASN.1 structure ElGamalParameter.
 * <p/>
 * <pre>
 *  ElGamalParameter ::= SEQUENCE {
 *                   prime INTEGER, -- p
 *                   base INTEGER, -- g}
 * </pre>
 */
protected byte[] engineGetEncoded()
{
    ElGamalParameter elP = new ElGamalParameter(currentSpec.getP(), currentSpec.getG());

    try
    {
        return elP.getEncoded(ASN1Encoding.DER);
    }
    catch (IOException e)
    {
        throw new RuntimeException("Error encoding ElGamalParameters");
    }
}
项目:irma_future_id    文件:BCElGamalPublicKey.java   
public byte[] getEncoded()
{
    try
    {
        SubjectPublicKeyInfo    info = new SubjectPublicKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new DERInteger(y));

        return info.getEncoded(ASN1Encoding.DER);
    }
    catch (IOException e)
    {
        return null;
    }
}
项目:bc-java    文件:JCEElGamalPrivateKey.java   
JCEElGamalPrivateKey(
    PrivateKeyInfo  info)
    throws IOException
{
    ElGamalParameter     params = new ElGamalParameter((ASN1Sequence)info.getAlgorithmId().getParameters());
    DERInteger      derX = ASN1Integer.getInstance(info.parsePrivateKey());

    this.x = derX.getValue();
    this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG());
}
项目:bc-java    文件:BCElGamalPrivateKey.java   
BCElGamalPrivateKey(
    PrivateKeyInfo info)
    throws IOException
{
    ElGamalParameter     params = new ElGamalParameter((ASN1Sequence)info.getAlgorithmId().getParameters());
    DERInteger      derX = ASN1Integer.getInstance(info.parsePrivateKey());

    this.x = derX.getValue();
    this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG());
}
项目:bc-java    文件:BCElGamalPrivateKey.java   
/**
 * Return a PKCS8 representation of the key. The sequence returned
 * represents a full PrivateKeyInfo object.
 *
 * @return a PKCS8 representation of the key.
 */
public byte[] getEncoded()
{
    try
    {
        PrivateKeyInfo          info = new PrivateKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new DERInteger(getX()));

        return info.getEncoded(ASN1Encoding.DER);
    }
    catch (IOException e)
    {
        return null;
    }
}
项目:bc-java    文件:AlgorithmParametersSpi.java   
/**
 * Return the X.509 ASN.1 structure ElGamalParameter.
 * <p/>
 * <pre>
 *  ElGamalParameter ::= SEQUENCE {
 *                   prime INTEGER, -- p
 *                   base INTEGER, -- g}
 * </pre>
 */
protected byte[] engineGetEncoded()
{
    ElGamalParameter elP = new ElGamalParameter(currentSpec.getP(), currentSpec.getG());

    try
    {
        return elP.getEncoded(ASN1Encoding.DER);
    }
    catch (IOException e)
    {
        throw new RuntimeException("Error encoding ElGamalParameters");
    }
}
项目:bc-java    文件:BCElGamalPublicKey.java   
public byte[] getEncoded()
{
    try
    {
        SubjectPublicKeyInfo    info = new SubjectPublicKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new DERInteger(y));

        return info.getEncoded(ASN1Encoding.DER);
    }
    catch (IOException e)
    {
        return null;
    }
}
项目:ipack    文件:JCEElGamalPublicKey.java   
public byte[] getEncoded()
{
    return KeyUtil.getEncodedSubjectPublicKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new DERInteger(y));
}
项目:Aki-SSL    文件:JCEElGamalPublicKey.java   
public byte[] getEncoded()
{
    return KeyUtil.getEncodedSubjectPublicKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new ASN1Integer(y));
}
项目:CryptMeme    文件:JCEElGamalPublicKey.java   
public byte[] getEncoded()
{
    return KeyUtil.getEncodedSubjectPublicKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new DERInteger(y));
}
项目:irma_future_id    文件:JCEElGamalPublicKey.java   
public byte[] getEncoded()
{
    return KeyUtil.getEncodedSubjectPublicKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new DERInteger(y));
}
项目:bc-java    文件:JCEElGamalPublicKey.java   
public byte[] getEncoded()
{
    return KeyUtil.getEncodedSubjectPublicKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new DERInteger(y));
}
项目:ipack    文件:JCEElGamalPrivateKey.java   
/**
 * Return a PKCS8 representation of the key. The sequence returned
 * represents a full PrivateKeyInfo object.
 *
 * @return a PKCS8 representation of the key.
 */
public byte[] getEncoded()
{
    return KeyUtil.getEncodedPrivateKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new DERInteger(getX()));
}
项目:Aki-SSL    文件:JCEElGamalPrivateKey.java   
/**
 * Return a PKCS8 representation of the key. The sequence returned
 * represents a full PrivateKeyInfo object.
 *
 * @return a PKCS8 representation of the key.
 */
public byte[] getEncoded()
{
    return KeyUtil.getEncodedPrivateKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new ASN1Integer(getX()));
}
项目:CryptMeme    文件:JCEElGamalPrivateKey.java   
/**
 * Return a PKCS8 representation of the key. The sequence returned
 * represents a full PrivateKeyInfo object.
 *
 * @return a PKCS8 representation of the key.
 */
public byte[] getEncoded()
{
    return KeyUtil.getEncodedPrivateKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new DERInteger(getX()));
}
项目:irma_future_id    文件:JCEElGamalPrivateKey.java   
/**
 * Return a PKCS8 representation of the key. The sequence returned
 * represents a full PrivateKeyInfo object.
 *
 * @return a PKCS8 representation of the key.
 */
public byte[] getEncoded()
{
    return KeyUtil.getEncodedPrivateKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new DERInteger(getX()));
}
项目:bc-java    文件:JCEElGamalPrivateKey.java   
/**
 * Return a PKCS8 representation of the key. The sequence returned
 * represents a full PrivateKeyInfo object.
 *
 * @return a PKCS8 representation of the key.
 */
public byte[] getEncoded()
{
    return KeyUtil.getEncodedPrivateKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new DERInteger(getX()));
}