Name

MACAlgorithm

Synopsis

This class implements the MAC for the JXTA platform. It is capable of performing a MAC based on arbitrary cipher and hash algorithms. Instances of this class are created by the JxtaCryptoSuite object based on the argument with which the suite is constructed. In order to use a MAC, the suite must be constructed with a profile that contains JxtaCrypto.MEMBER_RC4 and either JxtaCrypto.MEMBER_MD5 or JxtaCrypto.MEMBER_SHA1 (if both are specified, the MD5 algorithm will be used).

In addition, when you create the suite, you specify a second argument relating to the MAC type that must be either MAC.ALG_RC4_MD5 or MAC.ALG_RC4_SHA1. Note, however, that the hash algorithm used depends on the profile and not on the MAC type argument (although the correct type must be specified).

This class is not commonly used by the JXTA programmer.

public class MACAlgorithm implements jxta.security.mac.MAC {
// Public Constructors
   public MACAlgorithm(jxta.security.cipher.Cipher cipherAlg, byte theType,  jxta.security.hash.Hash theDigest) 
       throws jxta.security.exceptions.CryptoException;
// Methods Implementing MAC
   public int encrypt(byte[ ] inbuf, int offset, int inLength, byte[ ] macBuf, int macOffset) 
       throws jxta.security.exceptions.CryptoException;  
   public byte getAlgorithm();  
   public String getAlgorithmName();  
   public int getLength();  
   public void init(byte theMode, jxta.security.cipher.Key theKey, byte[ ] privateKey) throws jxta.security.exceptions.CryptoException; public ...

Get JXTA in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.