/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5008159 5008156
* @run main XMLEncKAT
* @summary Verify that the two key wrap ciphers, i.e. "DESedeWrap"
* and "AESWrap", work as expected.
* @author Valerie Peng
*/
public class XMLEncKAT {
private static byte[] desEdeKey_1;
private static byte[] aes128Key_1;
private static byte[] aes192Key_1;
private static byte[] aes256Key_1;
private static byte[] desEdeKey_2;
private static byte[] aes128Key_2;
private static byte[] aes192Key_2;
private static byte[] aes256Key_2;
static {
try {
} catch (UnsupportedEncodingException uee) {
// should never happen
}
try {
("yI+J1f3puYAERjIcT6vfg6RitmKX8nD0");
("01+yuQ2huPS1+Qv0LH+zaQ==");
("IlfuS40LvStVU0Mj8ePrrGHVhAb48y++");
("ZhZ4v3RlwTlCEOpIrHfLKVyJOBDtEJOOQDat/4xR1bA=");
} catch (IOException ioe) {
// should never happen
}
}
"gHMpx5iF7+KXtNHLasZrkcLHn8Ti4rxUjCIRK+IcgbQir6FUsQ/uxQ3o8enEMWq1"
};
"/PZvvn42E9dmMUZ8KCY6B5XtLaaIaG4X5YNDwgV5Vlo=",
"HgVuHoXxBQWD9fvi0gt9TanywZ5lJokM/12fcMG6gRoMjsCPulH+4A=="
};
"dV45TUpJbidb9iKa34xj1WVtTZ036cnqvym2TBJWR5c=",
};
};
"IbjZH7Mq564oMybpvCHWYM/5ER3eFsAV",
"19D633XVohP6UJvaVRAhJek+ahtM3gOiVs6nZyAasDEb+WCUQOcWZw=="
};
"5+GpVUQNTAT3uY8pPedEg/PpftiX+fJsTCun+fgmIz0=",
"iuZvvGBWScikHld9TtNIOz0Sm7Srg5AcxOBMA8qIvQY=",
"PeDwjnCsg6xWzs3SmzUtc2nyUz28nGu7"
};
"4AAgyi3M7xNdBimbQZKdGJLn3/cS4Yv8QKuA01+gUnY=",
"tPCC89jQShB+WDINCdRfKgf8wTlAx8xRXD73RmEHPBfix8zS1N82KQ==",
"bsL63D0hPN6EOyzdgfEmKsAAvoJiGM+Wp9a9KZM92IKdl7s3YSntRg=="
};
"IbnoS1cvuIFIGB46jj1V1FGftc92irrCwcC7BoBvxwQ=",
"ic+Om6/3ZKcThVN3iv9lUEankNkDv3Et",
"jOvQe4SxDqEMvAHcmb3Z+/Uedj23pvL6BRQsl2sjJlQ=",
};
// first test UNWRAP with known values
}
}
// then test WRAP and compare with the known values
base64Wrapped[i]);
}
}
}
wrapAlg = "AESWrap";
keyAlg = "AES";
// only run the tests on longer key lengths if unlimited version
// of JCE jurisdiction policy files are installed
}
}
}