示例#1
0
  /**
   * Returns if the current CryptoPacketExtension equals the one given in parameter.
   *
   * @param obj an object which might be an instance of CryptoPacketExtension.
   * @return True if the object in parameter is a CryptoPAcketExtension with all fields
   *     (crypto-suite, key-params, session-params and tag) corresponding to the current one. False,
   *     otherwsise.
   */
  @Override
  public boolean equals(Object obj) {
    if (obj instanceof CryptoPacketExtension) {
      CryptoPacketExtension crypto = (CryptoPacketExtension) obj;

      return (crypto.equalsCryptoSuite(this.getCryptoSuite())
          && crypto.equalsKeyParams(this.getKeyParams())
          && crypto.equalsSessionParams(this.getSessionParams())
          && crypto.equalsTag(this.getTag()));
    }
    return false;
  }
示例#2
0
 /**
  * Returns if the current tag equals the one given in parameter.
  *
  * @param tag a <tt>String</tt> containing a decimal number used as an identifier for a particular
  *     crypto element.
  * @return True if the current tag equals the one given in parameter. False, otherwise.
  */
 public boolean equalsTag(String tag) {
   String currentTag = this.getTag();
   return CryptoPacketExtension.equalsStrings(currentTag, tag);
 }
示例#3
0
 /**
  * Returns if the current key params equals the one given in parameter.
  *
  * @param keyParams a <tt>String</tt> that provides one or more sets of keying material for the
  *     crypto-suite in question.
  * @return True if the current key params equals the one given in parameter. False, otherwise.
  */
 public boolean equalsKeyParams(String keyParams) {
   String currentKeyParams = this.getKeyParams();
   return CryptoPacketExtension.equalsStrings(currentKeyParams, keyParams);
 }
示例#4
0
 /**
  * Returns if the current session params equals the one given in parameter.
  *
  * @param sessionParams a <tt>String</tt> that provides transport-specific parameters for SRTP
  *     negotiation.
  * @return True if the current session params equals the one given in parameter. False, otherwise.
  */
 public boolean equalsSessionParams(String sessionParams) {
   String currentSessionParams = this.getSessionParams();
   return CryptoPacketExtension.equalsStrings(currentSessionParams, sessionParams);
 }
示例#5
0
 /**
  * Returns if the current crypto suite equals the one given in parameter.
  *
  * @param cryptoSuite a <tt>String</tt> that describes the encryption and authentication
  *     algorithms.
  * @return True if the current crypto suite equals the one given in parameter. False, otherwise.
  */
 public boolean equalsCryptoSuite(String cryptoSuite) {
   String currentCryptoSuite = this.getCryptoSuite();
   return CryptoPacketExtension.equalsStrings(currentCryptoSuite, cryptoSuite);
 }