Class SrtpKeyParam

  • All Implemented Interfaces:
    KeyParam

    public class SrtpKeyParam
    extends java.lang.Object
    implements KeyParam
    SRTP security descriptions define the use of the "inline" key method. Use of any other keying method (e.g., URL) for SRTP security descriptions is for further study. The "inline" type of key contains the keying material (master key and salt) and all policy related to that master key, including how long it can be used (lifetime) and whether it uses a master key identifier (MKI) to associate an incoming SRTP packet with a particular master key.
    Author:
    Ingo Bauersachs
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String KEYMETHOD_INLINE
      Constant for the inline key method.
    • Constructor Summary

      Constructors 
      Constructor Description
      SrtpKeyParam​(java.lang.String keyParam)
      Creates a new instance of this class from the textual representation.
      SrtpKeyParam​(java.lang.String keyMethod, byte[] key, int lifetime, int mki, int mkiLength)
      Creates a new instance of this class from known parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String encode()
      Encodes the information contained in this object for use in the complete crypto attribute.
      byte[] getKey()
      Gets the concatenated master key and salt.
      java.lang.String getKeyMethod()
      The key method for this key parameter.
      int getLifetime()
      Gets the master key lifetime (max number of SRTP or SRTCP packets using this master key)
      int getMki()
      Gets the master key identifier in the SRTP packets.
      int getMkiLength()
      Gets the length of the MKI field in SRTP packets
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • KEYMETHOD_INLINE

        public static final java.lang.String KEYMETHOD_INLINE
        Constant for the inline key method.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SrtpKeyParam

        public SrtpKeyParam​(java.lang.String keyMethod,
                            byte[] key,
                            int lifetime,
                            int mki,
                            int mkiLength)
        Creates a new instance of this class from known parameters.
        Parameters:
        keyMethod - The key method for this key parameter. Only "inline" is currently supported.
        key - Concatenated master key and salt; MUST be a unique cryptographically random value with respect to other master keys in the entire SDP message (i.e., including master keys for other streams)
        lifetime - The master key lifetime (max number of SRTP or SRTCP packets using this master key)
        mki - The master key identifier in the SRTP packets.
        mkiLength - Length of the MKI field in SRTP packets.
      • SrtpKeyParam

        public SrtpKeyParam​(java.lang.String keyParam)
        Creates a new instance of this class from the textual representation.
        Parameters:
        keyParam - The textual representation of the key parameter.
    • Method Detail

      • getKeyMethod

        public java.lang.String getKeyMethod()
        The key method for this key parameter.
        Specified by:
        getKeyMethod in interface KeyParam
        Returns:
        "inline"
      • getKey

        public byte[] getKey()
        Gets the concatenated master key and salt.
        Returns:
        the concatenated master key and salt.
      • getLifetime

        public int getLifetime()
        Gets the master key lifetime (max number of SRTP or SRTCP packets using this master key)
        Returns:
        The master key lifetime.
      • getMki

        public int getMki()
        Gets the master key identifier in the SRTP packets.
        Returns:
        The master key identifier in the SRTP packets.
      • getMkiLength

        public int getMkiLength()
        Gets the length of the MKI field in SRTP packets
        Returns:
        The length of the MKI field in SRTP packets.
      • encode

        public java.lang.String encode()
        Description copied from interface: KeyParam
        Encodes the information contained in this object for use in the complete crypto attribute.
        Specified by:
        encode in interface KeyParam
        Returns:
        Textual representation of the key parameter.