KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > snmp > SnmpUsmKeyHandler


1 /*
2  * @(#)file SnmpUsmKeyHandler.java
3  * @(#)author Sun Microsystems, Inc.
4  * @(#)version 1.12
5  * @(#)date 08/02/09
6  *
7  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
8  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
9  *
10  */

11 package com.sun.jmx.snmp;
12
13 /**
14  * This interface allows you to compute key localization and delta generation. It is useful when adding user in USM MIB. An instance of <CODE> SnmpUsmKeyHandler </CODE> is associated to each <CODE> SnmpEngine </CODE> object.
15  * When computing key, an authentication algorithm is needed. The supported ones are : usmHMACMD5AuthProtocol and usmHMACSHAAuthProtocol.
16  * <p><b>This API is a Sun Microsystems internal API and is subject
17  * to change without notice.</b></p>
18  * @since 1.5
19  */

20 public interface SnmpUsmKeyHandler {
21     
22     /**
23      * DES privacy algorithm key size. To be used when localizing privacy key
24      */

25     public static int DES_KEY_SIZE = 16;
26
27     /**
28      * DES privacy algorithm delta size. To be used when calculing privacy key delta.
29      */

30     public static int DES_DELTA_SIZE = 16;
31     
32     /**
33      * Translate a password to a key. It MUST be compliant to RFC 2574 description.
34      * @param algoName The authentication algorithm to use.
35      * @param password Password to convert.
36      * @return The key.
37      * @exception IllegalArgumentException If the algorithm is unknown.
38      */

39     public byte[] password_to_key(String JavaDoc algoName, String JavaDoc password) throws IllegalArgumentException JavaDoc;
40     /**
41      * Localize the passed key using the passed <CODE>SnmpEngineId</CODE>. It MUST be compliant to RFC 2574 description.
42      * @param algoName The authentication algorithm to use.
43      * @param key The key to localize;
44      * @param engineId The Id used to localize the key.
45      * @return The localized key.
46      * @exception IllegalArgumentException If the algorithm is unknown.
47      */

48     public byte[] localizeAuthKey(String JavaDoc algoName, byte[] key, SnmpEngineId engineId) throws IllegalArgumentException JavaDoc;
49
50     /**
51      * Localize the passed privacy key using the passed <CODE>SnmpEngineId</CODE>. It MUST be compliant to RFC 2574 description.
52      * @param algoName The authentication algorithm to use.
53      * @param key The key to localize;
54      * @param engineId The Id used to localize the key.
55      * @param keysize The privacy algorithm key size.
56      * @return The localized key.
57      * @exception IllegalArgumentException If the algorithm is unknown.
58      */

59     public byte[] localizePrivKey(String JavaDoc algoName, byte[] key, SnmpEngineId engineId,int keysize) throws IllegalArgumentException JavaDoc;
60     
61     /**
62      * Calculate the delta parameter needed when processing key change. This computation is done by the key change initiator. It MUST be compliant to RFC 2574 description.
63      * @param algoName The authentication algorithm to use.
64      * @param oldKey The old key.
65      * @param newKey The new key.
66      * @param random The random value.
67      * @return The delta.
68      * @exception IllegalArgumentException If the algorithm is unknown.
69      */

70     public byte[] calculateAuthDelta(String JavaDoc algoName, byte[] oldKey, byte[] newKey, byte[] random) throws IllegalArgumentException JavaDoc;
71     
72     /**
73      * Calculate the delta parameter needed when processing key change for a privacy algorithm. This computation is done by the key change initiator. It MUST be compliant to RFC 2574 description.
74      * @param algoName The authentication algorithm to use.
75      * @param oldKey The old key.
76      * @param newKey The new key.
77      * @param random The random value.
78      * @param deltaSize The algo delta size.
79      * @return The delta.
80      * @exception IllegalArgumentException If the algorithm is unknown.
81      */

82     public byte[] calculatePrivDelta(String JavaDoc algoName, byte[] oldKey, byte[] newKey, byte[] random, int deltaSize) throws IllegalArgumentException JavaDoc;
83     
84 }
85
Popular Tags