Package gnu.javax.crypto.kwa

Examples of gnu.javax.crypto.kwa.IKeyWrappingAlgorithm.unwrap()


          }

        msg = "Input length for unwrapping MUST be 40 bytes";
        try
          {
            kwa.unwrap(km, 0, 24);
            harness.fail(msg);
          }
        catch (IllegalArgumentException e)
          {
            harness.check(true, msg);
View Full Code Here


        byte[] wrapped = kwa.wrap(km, 0, km.length);
        harness.check(wrapped.length == 40,
                      "Wrapped key material MUST produce 40 bytes");

        byte[] unwrapped = kwa.unwrap(wrapped, 0, wrapped.length);
        harness.check(unwrapped.length == 24,
                      "Unwrapped key material MUST produce 24 bytes");
        harness.check(Arrays.equals(km, unwrapped),
                      "Unwrapped key material MUST match original value");
      }
View Full Code Here

        int outputLength = kwa.wrap(km, 0, km.length, wrapped, 0);
        harness.check(outputLength == 16,
                      "Wrapped 64-bit key material MUST produce 16 bytes");

        byte[] unwrapped = new byte[8];
        outputLength = kwa.unwrap(wrapped, 0, wrapped.length, unwrapped, 0);
        harness.check(outputLength == 8,
                      "Unwrapped 128-bit key material MUST produce 8 bytes");
        harness.check(Arrays.equals(km, unwrapped),
                      "Unwrapped key material MUST match original value");
      }
View Full Code Here

        harness.check(Arrays.equals(wrappedKeyMaterial, wrapped),
                      keyMaterialLength + "-bit key material wrapped w/ "
                      + keyLength + "-bit KEK MUST match expected value");

        byte[] unwrapped = new byte[wrappedKeyMaterial.length - 8];
        kwa.unwrap(wrappedKeyMaterial, 0, wrappedKeyMaterial.length, unwrapped, 0);
        harness.check(Arrays.equals(keyMaterial, unwrapped),
                      keyMaterialLength + "-bit key material unwrapped w/ "
                      + keyLength + "-bit KEK MUST match expected value");
      }
    catch (Exception x)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.