2097N/A/*
2362N/A * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
2097N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2097N/A *
2097N/A * This code is free software; you can redistribute it and/or modify it
2097N/A * under the terms of the GNU General Public License version 2 only, as
2097N/A * published by the Free Software Foundation.
2097N/A *
2097N/A * This code is distributed in the hope that it will be useful, but WITHOUT
2097N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2097N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2097N/A * version 2 for more details (a copy is included in the LICENSE file that
2097N/A * accompanied this code).
2097N/A *
2097N/A * You should have received a copy of the GNU General Public License version
2097N/A * 2 along with this work; if not, write to the Free Software Foundation,
2097N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2097N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
2097N/A */
2097N/A/*
2097N/A * @test
2097N/A * @bug 6917791
2097N/A * @summary KeyTabEntry, when the byte value smaller then 16, the string drop '0'
2097N/A */
2097N/A
2097N/Aimport sun.security.krb5.internal.ktab.KeyTabEntry;
2097N/A
2097N/Apublic class KeyString {
2097N/A public static void main(String[] args) throws Exception {
2097N/A KeyTabEntry e = new KeyTabEntry(null, null, null, 1, 1, new byte[8]);
2097N/A // "0x" plus eight "00"
2097N/A if (e.getKeyString().length() != 18) {
2097N/A throw new Exception("key bytes length not correct");
2097N/A }
2097N/A }
2097N/A}