Java 类org.bouncycastle.asn1.pkcs.RC2CBCParameter 实例源码

项目:ipack    文件:RC2.java   
protected byte[] engineGetEncoded(
    String format)
    throws IOException
{
    if (this.isASN1FormatString(format))
    {
        if (parameterVersion == -1)
        {
            return new RC2CBCParameter(engineGetEncoded()).getEncoded();
        }
        else
        {
            return new RC2CBCParameter(parameterVersion, engineGetEncoded()).getEncoded();
        }
    }

    if (format.equals("RAW"))
    {
        return engineGetEncoded();
    }

    return null;
}
项目:Aki-SSL    文件:RC2.java   
protected byte[] engineGetEncoded(
    String format)
    throws IOException
{
    if (this.isASN1FormatString(format))
    {
        if (parameterVersion == -1)
        {
            return new RC2CBCParameter(engineGetEncoded()).getEncoded();
        }
        else
        {
            return new RC2CBCParameter(parameterVersion, engineGetEncoded()).getEncoded();
        }
    }

    if (format.equals("RAW"))
    {
        return engineGetEncoded();
    }

    return null;
}
项目:CryptMeme    文件:RC2.java   
protected byte[] engineGetEncoded(
    String format)
    throws IOException
{
    if (this.isASN1FormatString(format))
    {
        if (parameterVersion == -1)
        {
            return new RC2CBCParameter(engineGetEncoded()).getEncoded();
        }
        else
        {
            return new RC2CBCParameter(parameterVersion, engineGetEncoded()).getEncoded();
        }
    }

    if (format.equals("RAW"))
    {
        return engineGetEncoded();
    }

    return null;
}
项目:irma_future_id    文件:RC2.java   
protected byte[] engineGetEncoded(
    String format)
    throws IOException
{
    if (this.isASN1FormatString(format))
    {
        if (parameterVersion == -1)
        {
            return new RC2CBCParameter(engineGetEncoded()).getEncoded();
        }
        else
        {
            return new RC2CBCParameter(parameterVersion, engineGetEncoded()).getEncoded();
        }
    }

    if (format.equals("RAW"))
    {
        return engineGetEncoded();
    }

    return null;
}
项目:irma_future_id    文件:JDKAlgorithmParameters.java   
protected byte[] engineGetEncoded(
    String format) 
    throws IOException
{
    if (this.isASN1FormatString(format))
    {
        if (parameterVersion == -1)
        {
            return new RC2CBCParameter(engineGetEncoded()).getEncoded();
        }
        else
        {
            return new RC2CBCParameter(parameterVersion, engineGetEncoded()).getEncoded();
        }
    }

    if (format.equals("RAW"))
    {
        return engineGetEncoded();
    }

    return null;
}
项目:bc-java    文件:RC2.java   
protected byte[] engineGetEncoded(
    String format)
    throws IOException
{
    if (this.isASN1FormatString(format))
    {
        if (parameterVersion == -1)
        {
            return new RC2CBCParameter(engineGetEncoded()).getEncoded();
        }
        else
        {
            return new RC2CBCParameter(parameterVersion, engineGetEncoded()).getEncoded();
        }
    }

    if (format.equals("RAW"))
    {
        return engineGetEncoded();
    }

    return null;
}
项目:bc-java    文件:JDKAlgorithmParameters.java   
protected byte[] engineGetEncoded(
    String format) 
    throws IOException
{
    if (this.isASN1FormatString(format))
    {
        if (parameterVersion == -1)
        {
            return new RC2CBCParameter(engineGetEncoded()).getEncoded();
        }
        else
        {
            return new RC2CBCParameter(parameterVersion, engineGetEncoded()).getEncoded();
        }
    }

    if (format.equals("RAW"))
    {
        return engineGetEncoded();
    }

    return null;
}
项目:ipack    文件:RC2.java   
protected void engineInit(
    byte[] params,
    String format)
    throws IOException
{
    if (this.isASN1FormatString(format))
    {
        RC2CBCParameter p = RC2CBCParameter.getInstance(ASN1Primitive.fromByteArray(params));

        if (p.getRC2ParameterVersion() != null)
        {
            parameterVersion = p.getRC2ParameterVersion().intValue();
        }

        iv = p.getIV();

        return;
    }

    if (format.equals("RAW"))
    {
        engineInit(params);
        return;
    }

    throw new IOException("Unknown parameters format in IV parameters object");
}
项目:ipack    文件:EnvelopedDataHelper.java   
public AlgorithmIdentifier getAlgorithmIdentifier(ASN1ObjectIdentifier macOID, AlgorithmParameterSpec paramSpec)
{
    if (paramSpec instanceof IvParameterSpec)
    {
        return new AlgorithmIdentifier(macOID, new DEROctetString(((IvParameterSpec)paramSpec).getIV()));
    }

    if (paramSpec instanceof RC2ParameterSpec)
    {
        RC2ParameterSpec rc2Spec = (RC2ParameterSpec)paramSpec;

        int effKeyBits = ((RC2ParameterSpec)paramSpec).getEffectiveKeyBits();

        if (effKeyBits != -1)
        {
            int parameterVersion;

            if (effKeyBits < 256)
            {
                parameterVersion = rc2Table[effKeyBits];
            }
            else
            {
                parameterVersion = effKeyBits;
            }

            return new AlgorithmIdentifier(macOID, new RC2CBCParameter(parameterVersion, rc2Spec.getIV()));
        }

        return new AlgorithmIdentifier(macOID, new RC2CBCParameter(rc2Spec.getIV()));
    }

    throw new IllegalStateException("unknown parameter spec: " + paramSpec);
}
项目:Aki-SSL    文件:RC2.java   
protected void engineInit(
    byte[] params,
    String format)
    throws IOException
{
    if (this.isASN1FormatString(format))
    {
        RC2CBCParameter p = RC2CBCParameter.getInstance(ASN1Primitive.fromByteArray(params));

        if (p.getRC2ParameterVersion() != null)
        {
            parameterVersion = p.getRC2ParameterVersion().intValue();
        }

        iv = p.getIV();

        return;
    }

    if (format.equals("RAW"))
    {
        engineInit(params);
        return;
    }

    throw new IOException("Unknown parameters format in IV parameters object");
}
项目:Aki-SSL    文件:EnvelopedDataHelper.java   
public AlgorithmIdentifier getAlgorithmIdentifier(ASN1ObjectIdentifier macOID, AlgorithmParameterSpec paramSpec)
{
    if (paramSpec instanceof IvParameterSpec)
    {
        return new AlgorithmIdentifier(macOID, new DEROctetString(((IvParameterSpec)paramSpec).getIV()));
    }

    if (paramSpec instanceof RC2ParameterSpec)
    {
        RC2ParameterSpec rc2Spec = (RC2ParameterSpec)paramSpec;

        int effKeyBits = ((RC2ParameterSpec)paramSpec).getEffectiveKeyBits();

        if (effKeyBits != -1)
        {
            int parameterVersion;

            if (effKeyBits < 256)
            {
                parameterVersion = rc2Table[effKeyBits];
            }
            else
            {
                parameterVersion = effKeyBits;
            }

            return new AlgorithmIdentifier(macOID, new RC2CBCParameter(parameterVersion, rc2Spec.getIV()));
        }

        return new AlgorithmIdentifier(macOID, new RC2CBCParameter(rc2Spec.getIV()));
    }

    throw new IllegalStateException("unknown parameter spec: " + paramSpec);
}
项目:CryptMeme    文件:RC2.java   
protected void engineInit(
    byte[] params,
    String format)
    throws IOException
{
    if (this.isASN1FormatString(format))
    {
        RC2CBCParameter p = RC2CBCParameter.getInstance(ASN1Primitive.fromByteArray(params));

        if (p.getRC2ParameterVersion() != null)
        {
            parameterVersion = p.getRC2ParameterVersion().intValue();
        }

        iv = p.getIV();

        return;
    }

    if (format.equals("RAW"))
    {
        engineInit(params);
        return;
    }

    throw new IOException("Unknown parameters format in IV parameters object");
}
项目:irma_future_id    文件:EnvelopedDataHelper.java   
public AlgorithmIdentifier getAlgorithmIdentifier(ASN1ObjectIdentifier macOID, AlgorithmParameterSpec paramSpec)
{
    if (paramSpec instanceof IvParameterSpec)
    {
        return new AlgorithmIdentifier(macOID, new DEROctetString(((IvParameterSpec)paramSpec).getIV()));
    }

    if (paramSpec instanceof RC2ParameterSpec)
    {
        RC2ParameterSpec rc2Spec = (RC2ParameterSpec)paramSpec;

        int effKeyBits = ((RC2ParameterSpec)paramSpec).getEffectiveKeyBits();

        if (effKeyBits != -1)
        {
            int parameterVersion;

            if (effKeyBits < 256)
            {
                parameterVersion = rc2Table[effKeyBits];
            }
            else
            {
                parameterVersion = effKeyBits;
            }

            return new AlgorithmIdentifier(macOID, new RC2CBCParameter(parameterVersion, rc2Spec.getIV()));
        }

        return new AlgorithmIdentifier(macOID, new RC2CBCParameter(rc2Spec.getIV()));
    }

    throw new IllegalStateException("unknown parameter spec: " + paramSpec);
}
项目:irma_future_id    文件:EnvelopedDataHelper.java   
public AlgorithmIdentifier getAlgorithmIdentifier(ASN1ObjectIdentifier macOID, AlgorithmParameterSpec paramSpec)
{
    if (paramSpec instanceof IvParameterSpec)
    {
        return new AlgorithmIdentifier(macOID, new DEROctetString(((IvParameterSpec)paramSpec).getIV()));
    }

    if (paramSpec instanceof RC2ParameterSpec)
    {
        RC2ParameterSpec rc2Spec = (RC2ParameterSpec)paramSpec;

        int effKeyBits = ((RC2ParameterSpec)paramSpec).getEffectiveKeyBits();

        if (effKeyBits != -1)
        {
            int parameterVersion;

            if (effKeyBits < 256)
            {
                parameterVersion = rc2Table[effKeyBits];
            }
            else
            {
                parameterVersion = effKeyBits;
            }

            return new AlgorithmIdentifier(macOID, new RC2CBCParameter(parameterVersion, rc2Spec.getIV()));
        }

        return new AlgorithmIdentifier(macOID, new RC2CBCParameter(rc2Spec.getIV()));
    }

    throw new IllegalStateException("unknown parameter spec: " + paramSpec);
}
项目:irma_future_id    文件:RC2.java   
protected void engineInit(
    byte[] params,
    String format)
    throws IOException
{
    if (this.isASN1FormatString(format))
    {
        RC2CBCParameter p = RC2CBCParameter.getInstance(ASN1Primitive.fromByteArray(params));

        if (p.getRC2ParameterVersion() != null)
        {
            parameterVersion = p.getRC2ParameterVersion().intValue();
        }

        iv = p.getIV();

        return;
    }

    if (format.equals("RAW"))
    {
        engineInit(params);
        return;
    }

    throw new IOException("Unknown parameters format in IV parameters object");
}
项目:irma_future_id    文件:JDKAlgorithmParameters.java   
protected void engineInit(
    byte[] params,
    String format) 
    throws IOException
{
    if (this.isASN1FormatString(format))
    {
        ASN1InputStream         aIn = new ASN1InputStream(params);
        RC2CBCParameter         p = RC2CBCParameter.getInstance(aIn.readObject());

        if (p.getRC2ParameterVersion() != null)
        {
            parameterVersion = p.getRC2ParameterVersion().intValue();
        }

        iv = p.getIV();

        return;
    }

    if (format.equals("RAW"))
    {
        engineInit(params);
        return;
    }

    throw new IOException("Unknown parameters format in IV parameters object");
}
项目:bc-java    文件:EnvelopedDataHelper.java   
public AlgorithmIdentifier getAlgorithmIdentifier(ASN1ObjectIdentifier macOID, AlgorithmParameterSpec paramSpec)
{
    if (paramSpec instanceof IvParameterSpec)
    {
        return new AlgorithmIdentifier(macOID, new DEROctetString(((IvParameterSpec)paramSpec).getIV()));
    }

    if (paramSpec instanceof RC2ParameterSpec)
    {
        RC2ParameterSpec rc2Spec = (RC2ParameterSpec)paramSpec;

        int effKeyBits = ((RC2ParameterSpec)paramSpec).getEffectiveKeyBits();

        if (effKeyBits != -1)
        {
            int parameterVersion;

            if (effKeyBits < 256)
            {
                parameterVersion = rc2Table[effKeyBits];
            }
            else
            {
                parameterVersion = effKeyBits;
            }

            return new AlgorithmIdentifier(macOID, new RC2CBCParameter(parameterVersion, rc2Spec.getIV()));
        }

        return new AlgorithmIdentifier(macOID, new RC2CBCParameter(rc2Spec.getIV()));
    }

    throw new IllegalStateException("unknown parameter spec: " + paramSpec);
}
项目:bc-java    文件:EnvelopedDataHelper.java   
public AlgorithmIdentifier getAlgorithmIdentifier(ASN1ObjectIdentifier macOID, AlgorithmParameterSpec paramSpec)
{
    if (paramSpec instanceof IvParameterSpec)
    {
        return new AlgorithmIdentifier(macOID, new DEROctetString(((IvParameterSpec)paramSpec).getIV()));
    }

    if (paramSpec instanceof RC2ParameterSpec)
    {
        RC2ParameterSpec rc2Spec = (RC2ParameterSpec)paramSpec;

        int effKeyBits = ((RC2ParameterSpec)paramSpec).getEffectiveKeyBits();

        if (effKeyBits != -1)
        {
            int parameterVersion;

            if (effKeyBits < 256)
            {
                parameterVersion = rc2Table[effKeyBits];
            }
            else
            {
                parameterVersion = effKeyBits;
            }

            return new AlgorithmIdentifier(macOID, new RC2CBCParameter(parameterVersion, rc2Spec.getIV()));
        }

        return new AlgorithmIdentifier(macOID, new RC2CBCParameter(rc2Spec.getIV()));
    }

    throw new IllegalStateException("unknown parameter spec: " + paramSpec);
}
项目:bc-java    文件:RC2.java   
protected void engineInit(
    byte[] params,
    String format)
    throws IOException
{
    if (this.isASN1FormatString(format))
    {
        RC2CBCParameter p = RC2CBCParameter.getInstance(ASN1Primitive.fromByteArray(params));

        if (p.getRC2ParameterVersion() != null)
        {
            parameterVersion = p.getRC2ParameterVersion().intValue();
        }

        iv = p.getIV();

        return;
    }

    if (format.equals("RAW"))
    {
        engineInit(params);
        return;
    }

    throw new IOException("Unknown parameters format in IV parameters object");
}
项目:bc-java    文件:JDKAlgorithmParameters.java   
protected void engineInit(
    byte[] params,
    String format) 
    throws IOException
{
    if (this.isASN1FormatString(format))
    {
        ASN1InputStream         aIn = new ASN1InputStream(params);
        RC2CBCParameter         p = RC2CBCParameter.getInstance(aIn.readObject());

        if (p.getRC2ParameterVersion() != null)
        {
            parameterVersion = p.getRC2ParameterVersion().intValue();
        }

        iv = p.getIV();

        return;
    }

    if (format.equals("RAW"))
    {
        engineInit(params);
        return;
    }

    throw new IOException("Unknown parameters format in IV parameters object");
}