Package org.bouncycastle.crypto.engines

Examples of org.bouncycastle.crypto.engines.DESedeWrapEngine


    public static class Wrap
        extends BaseWrapCipher
    {
        public Wrap()
        {
            super(new DESedeWrapEngine());
        }
View Full Code Here


    public static class DESEDEWrap
        extends WrapCipherSpi
    {
        public DESEDEWrap()
        {
            super(new DESedeWrapEngine());
        }
View Full Code Here

        byte[]  kek,
        byte[]  iv,
        byte[]  in,
        byte[]  out)
    {
        Wrapper wrapper = new DESedeWrapEngine();

        wrapper.init(true, new ParametersWithIV(new KeyParameter(kek), iv));

        try
        {
            byte[]  cText = wrapper.wrap(in, 0, in.length);
            if (!Arrays.areEqual(cText, out))
            {
                return new SimpleTestResult(false, getName() + ": failed wrap test " + id  + " expected " + new String(Hex.encode(out)) + " got " + new String(Hex.encode(cText)));
            }
        }
        catch (Exception e)
        {
            return new SimpleTestResult(false, getName() + ": failed wrap test exception " + e.toString());
        }

        wrapper.init(false, new KeyParameter(kek));

        try
        {
            byte[]  pText = wrapper.unwrap(out, 0, out.length);
            if (!Arrays.areEqual(pText, in))
            {
                return new SimpleTestResult(false, getName() + ": failed unwrap test " + id  + " expected " + new String(Hex.encode(in)) + " got " + new String(Hex.encode(pText)));
            }
        }
View Full Code Here

    public static class DESEDEWrap
        extends WrapCipherSpi
    {
        public DESEDEWrap()
        {
            super(new DESedeWrapEngine());
        }
View Full Code Here

    public static class DESEDEWrap
        extends WrapCipherSpi
    {
        public DESEDEWrap()
        {
            super(new DESedeWrapEngine());
        }
View Full Code Here

TOP

Related Classes of org.bouncycastle.crypto.engines.DESedeWrapEngine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.