| org.snmp4j.security.PrivacyProtocol
All known Subclasses: org.snmp4j.security.PrivAES, org.snmp4j.security.PrivDES, org.snmp4j.security.Priv3DES,
PrivacyProtocol | public interface PrivacyProtocol extends SecurityProtocol(Code) | | The PrivacyProtocol interface defines a common
interface for all SNMP privacy protocols.
author: Jochen Katz & Frank Fock version: 1.9 |
Method Summary | |
byte[] | decrypt(byte[] cryptedData, int offset, int length, byte[] decryptionKey, long engineBoots, long engineTime, DecryptParams decryptParams) Decrypts a message using a given decryption key, engine boots count, and
engine ID.
Parameters: cryptedData - the crypted data. | byte[] | encrypt(byte[] unencryptedData, int offset, int length, byte[] encryptionKey, long engineBoots, long engineTime, DecryptParams decryptParams) Encrypts a message using a given encryption key, engine boots count, and
engine ID.
Parameters: unencryptedData - the unencrypted data. | byte[] | extendShortKey(byte[] shortKey, OctetString password, byte[] engineID, AuthenticationProtocol authProtocol) Extend a localized key that is too short.
Some privacy protocols require a key that is longer than the key
generated by the pasword to key algorithm of the authentication
protocol. | int | getDecryptParamsLength() Gets the length of the decryption parameters used by this security
protocol. | int | getEncryptedLength(int scopedPDULength) Gets the length of a scoped PDU when encrypted with this security protocol. | OID | getID() Gets the OID uniquely identifying the privacy protocol. | int | getMaxKeyLength() Gets the maximum key size for this privacy protcol. | int | getMinKeyLength() Gets the minimum key size for this privacy protcol. |
decrypt | byte[] decrypt(byte[] cryptedData, int offset, int length, byte[] decryptionKey, long engineBoots, long engineTime, DecryptParams decryptParams)(Code) | | Decrypts a message using a given decryption key, engine boots count, and
engine ID.
Parameters: cryptedData - the crypted data. This byte array may contain leading and trailingbytes that will not be decrypted. Parameters: offset - the offset into the cryptedData where to startencryption. Parameters: length - the length of the substring starting at offset to decrypt. Parameters: decryptionKey - the key to be used for decryption. Parameters: engineBoots - the engine boots counter to use. Parameters: engineTime - the engine time to use. Parameters: decryptParams - contains the decryption parameters.the decrypted data, or null if decryption failed. |
encrypt | byte[] encrypt(byte[] unencryptedData, int offset, int length, byte[] encryptionKey, long engineBoots, long engineTime, DecryptParams decryptParams)(Code) | | Encrypts a message using a given encryption key, engine boots count, and
engine ID.
Parameters: unencryptedData - the unencrypted data. This byte array may contain leading and trailingbytes that will not be encrypted. Parameters: offset - the offset into the unencryptedData where to startencryption. Parameters: length - the length of the substring starting at offset to encrypt. Parameters: encryptionKey - the key to be used for encryption. Parameters: engineBoots - the engine boots counter to use. Parameters: engineTime - the engine time to use. Parameters: decryptParams - returns the decryption parameters needed to decrypt the data thathas been encrypted by this method.the encrypted copy of unencryptedData . |
extendShortKey | byte[] extendShortKey(byte[] shortKey, OctetString password, byte[] engineID, AuthenticationProtocol authProtocol)(Code) | | Extend a localized key that is too short.
Some privacy protocols require a key that is longer than the key
generated by the pasword to key algorithm of the authentication
protocol. This function extends a short key to the required length.
Parameters: shortKey - the short key that was generated usingAuthenticationProtocol.passwordToKey function. Parameters: password - the password to use for key extension. Parameters: engineID - the SNMP engine ID of the authoritative engine. Parameters: authProtocol - the authentication protocol that should be used.the extended key or shortKey if no extension is needed. since: 1.9 |
getDecryptParamsLength | int getDecryptParamsLength()(Code) | | Gets the length of the decryption parameters used by this security
protocol.
a positive integer denoting the length of decryption parameters returnedby this security protocol. |
getEncryptedLength | int getEncryptedLength(int scopedPDULength)(Code) | | Gets the length of a scoped PDU when encrypted with this security protocol.
Parameters: scopedPDULength - the length of the (unencrypted) scoped PDU.the length of the encrypted scoped PDU. |
getID | OID getID()(Code) | | Gets the OID uniquely identifying the privacy protocol.
an OID instance. |
getMaxKeyLength | int getMaxKeyLength()(Code) | | Gets the maximum key size for this privacy protcol.
the minimum key size for this privacy protcol. |
getMinKeyLength | int getMinKeyLength()(Code) | | Gets the minimum key size for this privacy protcol.
the minimum key size for this privacy protcol. |
|
|