# Print output for @column tags ?>
  public
  
  final
  
  class
  IpSecAlgorithm
  
    extends Object
  
  
  
  
  
      implements
      
        Parcelable
      
  
  
| java.lang.Object | |
| ↳ | android.net.IpSecAlgorithm | 
This class represents a single algorithm that can be used by an IpSecTransform.
Constants | |
|---|---|
String | 
        
          AUTH_CRYPT_AES_GCM
          AES-GCM Authentication/Integrity + Encryption/Ciphering Algorithm.  | 
    
String | 
        
          AUTH_HMAC_MD5
          MD5 HMAC Authentication/Integrity Algorithm.  | 
    
String | 
        
          AUTH_HMAC_SHA1
          SHA1 HMAC Authentication/Integrity Algorithm.  | 
    
String | 
        
          AUTH_HMAC_SHA256
          SHA256 HMAC Authentication/Integrity Algorithm.  | 
    
String | 
        
          AUTH_HMAC_SHA384
          SHA384 HMAC Authentication/Integrity Algorithm.  | 
    
String | 
        
          AUTH_HMAC_SHA512
          SHA512 HMAC Authentication/Integrity Algorithm.  | 
    
String | 
        
          CRYPT_AES_CBC
          AES-CBC Encryption/Ciphering Algorithm.  | 
    
Inherited constants | 
|---|
Fields | |
|---|---|
    public
    static
    final
    Creator<IpSecAlgorithm> | 
    
      CREATOR
      Parcelable Creator  | 
  
Public constructors | |
|---|---|
      
      IpSecAlgorithm(String algorithm, byte[] key)
      
      
        Creates an IpSecAlgorithm of one of the supported types.  | 
  |
      
      IpSecAlgorithm(String algorithm, byte[] key, int truncLenBits)
      
      
        Creates an IpSecAlgorithm of one of the supported types.  | 
  |
Public methods | |
|---|---|
        
        
        
        
        
        int
     | 
  
    
      
      describeContents()
      
      
        Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.  | 
  
        
        
        
        
        
        byte[]
     | 
  
    
      
      getKey()
      
      
        Get the key for this algorithm  | 
  
        
        
        
        
        
        String
     | 
  
    
      
      getName()
      
      
        Get the algorithm name  | 
  
        
        
        
        
        
        int
     | 
  
    
      
      getTruncationLengthBits()
      
      
        Get the truncation length of this algorithm, in bits  | 
  
        
        
        
        
        
        String
     | 
  
    
      
      toString()
      
      
        Returns a string representation of the object.  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      writeToParcel(Parcel out, int flags)
      
      
        Write to parcel  | 
  
Inherited methods | |
|---|---|
public static final String AUTH_CRYPT_AES_GCM
AES-GCM Authentication/Integrity + Encryption/Ciphering Algorithm.
Valid lengths for keying material are {160, 224, 288}.
As per RFC4106 (Section 8.1), keying material consists of a 128, 192, or 256 bit AES key followed by a 32-bit salt. RFC compliance requires that the salt must be unique per invocation with the same key.
Valid ICV (truncation) lengths are {64, 96, 128}.
Constant Value: "rfc4106(gcm(aes))"
public static final String AUTH_HMAC_MD5
MD5 HMAC Authentication/Integrity Algorithm. This algorithm is not recommended for use in new applications and is provided for legacy compatibility with 3gpp infrastructure.
Keys for this algorithm must be 128 bits in length.
Valid truncation lengths are multiples of 8 bits from 96 to 128.
Constant Value: "hmac(md5)"
public static final String AUTH_HMAC_SHA1
SHA1 HMAC Authentication/Integrity Algorithm. This algorithm is not recommended for use in new applications and is provided for legacy compatibility with 3gpp infrastructure.
Keys for this algorithm must be 160 bits in length.
Valid truncation lengths are multiples of 8 bits from 96 to 160.
Constant Value: "hmac(sha1)"
public static final String AUTH_HMAC_SHA256
SHA256 HMAC Authentication/Integrity Algorithm.
Keys for this algorithm must be 256 bits in length.
Valid truncation lengths are multiples of 8 bits from 96 to 256.
Constant Value: "hmac(sha256)"
public static final String AUTH_HMAC_SHA384
SHA384 HMAC Authentication/Integrity Algorithm.
Keys for this algorithm must be 384 bits in length.
Valid truncation lengths are multiples of 8 bits from 192 to 384.
Constant Value: "hmac(sha384)"
public static final String AUTH_HMAC_SHA512
SHA512 HMAC Authentication/Integrity Algorithm.
Keys for this algorithm must be 512 bits in length.
Valid truncation lengths are multiples of 8 bits from 256 to 512.
Constant Value: "hmac(sha512)"
public static final String CRYPT_AES_CBC
AES-CBC Encryption/Ciphering Algorithm.
Valid lengths for this key are {128, 192, 256}.
Constant Value: "cbc(aes)"
public IpSecAlgorithm (String algorithm, byte[] key)
Creates an IpSecAlgorithm of one of the supported types. Supported algorithm names are defined as constants in this class.
For algorithms that produce an integrity check value, the truncation length is a required
 parameter. See IpSecAlgorithm(java.lang.String, byte[], int)
| Parameters | |
|---|---|
algorithm | 
        
          String: name of the algorithm.
 This value cannot be null.
 Value is CRYPT_AES_CBC, AUTH_HMAC_MD5, AUTH_HMAC_SHA1, AUTH_HMAC_SHA256, AUTH_HMAC_SHA384, AUTH_HMAC_SHA512, or AUTH_CRYPT_AES_GCM | 
      
key | 
        
          byte: key padded to a multiple of 8 bits.
 
 This value cannot be null. | 
      
public IpSecAlgorithm (String algorithm, byte[] key, int truncLenBits)
Creates an IpSecAlgorithm of one of the supported types. Supported algorithm names are defined as constants in this class.
This constructor only supports algorithms that use a truncation length. i.e. Authentication and Authenticated Encryption algorithms.
| Parameters | |
|---|---|
algorithm | 
        
          String: name of the algorithm.
 This value cannot be null.
 Value is CRYPT_AES_CBC, AUTH_HMAC_MD5, AUTH_HMAC_SHA1, AUTH_HMAC_SHA256, AUTH_HMAC_SHA384, AUTH_HMAC_SHA512, or AUTH_CRYPT_AES_GCM | 
      
key | 
        
          byte: key padded to a multiple of 8 bits.
 This value cannot be null. | 
      
truncLenBits | 
        
          int: number of bits of output hash to use. | 
      
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
 instance's marshaled representation. For example, if the object will
 include a file descriptor in the output of writeToParcel(android.os.Parcel, int),
 the return value of this method must include the
 CONTENTS_FILE_DESCRIPTOR bit.
| Returns | |
|---|---|
int | 
        a bitmask indicating the set of special object types marshaled
 by this Parcelable object instance.
 
 Value is either 0 or CONTENTS_FILE_DESCRIPTOR | 
      
public byte[] getKey ()
Get the key for this algorithm
| Returns | |
|---|---|
byte[] | 
        This value cannot be null. | 
      
public int getTruncationLengthBits ()
Get the truncation length of this algorithm, in bits
| Returns | |
|---|---|
int | 
        |
public String toString ()
Returns a string representation of the object. In general, the
 toString method returns a string that
 "textually represents" this object. The result should
 be a concise but informative representation that is easy for a
 person to read.
 It is recommended that all subclasses override this method.
 
 The toString method for class Object
 returns a string consisting of the name of the class of which the
 object is an instance, the at-sign character `@', and
 the unsigned hexadecimal representation of the hash code of the
 object. In other words, this method returns a string equal to the
 value of:
 
getClass().getName() + '@' + Integer.toHexString(hashCode())
| Returns | |
|---|---|
String | 
        This value cannot be null. | 
      
public void writeToParcel (Parcel out, int flags)
Write to parcel
| Parameters | |
|---|---|
out | 
        
          Parcel: The Parcel in which the object should be written. | 
      
flags | 
        
          int: Additional flags about how the object should be written.
 May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
 
 Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |