Class SrtpSDesFactory

  • All Implemented Interfaces:
    SDesFactory

    public class SrtpSDesFactory
    extends java.lang.Object
    implements SDesFactory
    Factory for the SRTP grammar of RFC4568.
    Author:
    Ingo Bauersachs
    • Constructor Detail

      • SrtpSDesFactory

        public SrtpSDesFactory()
    • Method Detail

      • createCryptoAttribute

        public SrtpCryptoAttribute createCryptoAttribute​(int tag,
                                                         java.lang.String keyAlg)
        Creates an SRTP crypto attribute with the specified parameters, for use in an SDP.

        If no random generator is set with setRandomGenerator(Random) then the SHA1PRNG, or if not available, the system's default SecureRandom will be used.

        Parameters:
        tag - decimal number used as an identifier for a particular crypto attribute
        keyAlg - identifier that describes the encryption and authentication algorithms
        Returns:
        SRTP crypto attribute without session parameters.
      • createCryptoAttribute

        public SrtpCryptoAttribute createCryptoAttribute​(int tag,
                                                         java.lang.String keyAlg,
                                                         SrtpSessionParam[] params)
        Creates an SRTP crypto attribute with the specified parameters, for use in an SDP.
        Parameters:
        tag - decimal number used as an identifier for a particular crypto attribute
        keyAlg - identifier that describes the encryption and authentication algorithms
        params - Session parameters for the crypto attribute
        Returns:
        SRTP crypto attribute without session parameters.
      • setRandomGenerator

        public void setRandomGenerator​(java.util.Random r)
        Description copied from interface: SDesFactory
        Sets the random number generator to be used for generating the SDES keys.
        Specified by:
        setRandomGenerator in interface SDesFactory
        Parameters:
        r - The random number generator.
      • createCryptoAttribute

        public SrtpCryptoAttribute createCryptoAttribute()
        Description copied from interface: SDesFactory
        Creates an empty crypto attribute for the grammar implementing this interface.
        Specified by:
        createCryptoAttribute in interface SDesFactory
        Returns:
        Empty crypto attribute to be filled by a parser.
      • createCryptoSuite

        public SrtpCryptoSuite createCryptoSuite​(java.lang.String suite)
        Description copied from interface: SDesFactory
        Creates a crypto suite instance for the grammar implementing this interface.
        Specified by:
        createCryptoSuite in interface SDesFactory
        Parameters:
        suite - The suite name that defines the cryptographic parameters.
        Returns:
        A crypto suite instance based on the supplied suite name.
      • createKeyParam

        public SrtpKeyParam createKeyParam​(java.lang.String keyParam)
        Description copied from interface: SDesFactory
        Creates a key parameter instance for the grammar implementing this interface.
        Specified by:
        createKeyParam in interface SDesFactory
        Parameters:
        keyParam - The textual representation of the key parameter field.
        Returns:
        The parsed key parameter.
      • createKeyParamArray

        public SrtpKeyParam[] createKeyParamArray​(int size)
        Description copied from interface: SDesFactory
        Utility method to create a typed array of KeyParameters.
        Specified by:
        createKeyParamArray in interface SDesFactory
        Parameters:
        size - The size of the array to create.
        Returns:
        KeyParam array of the specified size.
      • createSessionParam

        public SrtpSessionParam createSessionParam​(java.lang.String sessionParam)
        Description copied from interface: SDesFactory
        Creates a session parameter instance for the grammar implementing this interface.
        Specified by:
        createSessionParam in interface SDesFactory
        Parameters:
        sessionParam - The textual representation of the session parameter.
        Returns:
        The parsed session parameter.
      • createSessionParamArray

        public SrtpSessionParam[] createSessionParamArray​(int size)
        Description copied from interface: SDesFactory
        Utility method to create a typed array of SessionParams.
        Specified by:
        createSessionParamArray in interface SDesFactory
        Parameters:
        size - The size of the array to create.
        Returns:
        SessionParam array of the specified size.