01: /*
02: *
03: *
04: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: */
26:
27: package com.sun.satsa.pki;
28:
29: /**
30: * This class represents PKCS#15 private key.
31: */
32: class PrivateKey {
33:
34: /** User friendly key label. */
35: String label;
36: /** Authentication object identifier. */
37: int authId;
38: /** Key identifier. */
39: byte[] id;
40: /** Can this key be used for authentication purposes? */
41: boolean authentication;
42: /** Can this key be used for non-repudiation purposes? */
43: boolean nonRepudiation;
44: /** Key reference attribute. */
45: int keyReference;
46: /** Modulus length attribute. */
47: int modulusLength;
48: /** Path attribute. */
49: short[] path;
50:
51: /**
52: * Print information.
53: * /
54: void print() {
55: // IMPL_NOTE: remove after debugging
56: System.out.println("Private key");
57: System.out.println("label " + label);
58: System.out.println("authID " + authId);
59: System.out.println("id " + Utils.hexEncode(id, 0, id.length, 9999));
60: if (authentication) {
61: System.out.println("authentication");
62: }
63: if (nonRepudiation) {
64: System.out.println("nonRepudiation");
65: }
66: System.out.println("keyReference " + keyReference);
67: System.out.println("modulusLength " + modulusLength);
68: System.out.print("path ");
69: Utils.print(path, path.length);
70: System.out.println("");
71: }
72: */
73: }
|