javax.crypto.Mac.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(13.1k)|赞(0)|评价(0)|浏览(220)

本文整理了Java中javax.crypto.Mac.<init>()方法的一些代码示例,展示了Mac.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mac.<init>()方法的具体详情如下:
包路径:javax.crypto.Mac
类名称:Mac
方法名:<init>

Mac.<init>介绍

[英]Creates a new Mac instance.
[中]创建一个新的Mac实例。

代码示例

代码示例来源:origin: robovm/robovm

/**
   * Clones this {@code Mac} instance and the underlying implementation.
   *
   * @return the cloned instance.
   * @throws CloneNotSupportedException
   *             if the underlying implementation does not support cloning.
   */
  @Override
  public final Object clone() throws CloneNotSupportedException {
    MacSpi newSpiImpl = (MacSpi)spiImpl.clone();
    Mac mac = new Mac(newSpiImpl, this.provider, this.algorithm);
    mac.isInitMac = this.isInitMac;
    return mac;
  }
}

代码示例来源:origin: robovm/robovm

/**
 * Creates a new {@code Mac} instance that provides the specified MAC
 * algorithm.
 *
 * @param algorithm
 *            the name of the requested MAC algorithm.
 * @return the new {@code Mac} instance.
 * @throws NoSuchAlgorithmException
 *             if the specified algorithm is not available by any provider.
 * @throws NullPointerException
 *             if {@code algorithm} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release).
 */
public static final Mac getInstance(String algorithm)
    throws NoSuchAlgorithmException {
  if (algorithm == null) {
    throw new NullPointerException("algorithm == null");
  }
  Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null);
  return new Mac((MacSpi) sap.spi, sap.provider, algorithm);
}

代码示例来源:origin: robovm/robovm

/**
 * Creates a new {@code Mac} instance that provides the specified MAC
 * algorithm from the specified provider.
 *
 * @param algorithm
 *            the name of the requested MAC algorithm.
 * @param provider
 *            the provider that is providing the algorithm.
 * @return the new {@code Mac} instance.
 * @throws NoSuchAlgorithmException
 *             if the specified algorithm is not provided by the specified
 *             provider.
 * @throws IllegalArgumentException
 *             if {@code provider} is {@code null}.
 * @throws NullPointerException
 *             if {@code algorithm} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release).
 */
public static final Mac getInstance(String algorithm, Provider provider)
    throws NoSuchAlgorithmException {
  if (provider == null) {
    throw new IllegalArgumentException("provider == null");
  }
  if (algorithm == null) {
    throw new NullPointerException("algorithm == null");
  }
  Object spi = ENGINE.getInstance(algorithm, provider, null);
  return new Mac((MacSpi) spi, provider, algorithm);
}

代码示例来源:origin: MobiVM/robovm

/**
   * Clones this {@code Mac} instance and the underlying implementation.
   *
   * @return the cloned instance.
   * @throws CloneNotSupportedException
   *             if the underlying implementation does not support cloning.
   */
  @Override
  public final Object clone() throws CloneNotSupportedException {
    MacSpi newSpiImpl = (MacSpi)spiImpl.clone();
    Mac mac = new Mac(newSpiImpl, this.provider, this.algorithm);
    mac.isInitMac = this.isInitMac;
    return mac;
  }
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
   * Clones this {@code Mac} instance and the underlying implementation.
   *
   * @return the cloned instance.
   * @throws CloneNotSupportedException
   *             if the underlying implementation does not support cloning.
   */
  @Override
  public final Object clone() throws CloneNotSupportedException {
    MacSpi newSpiImpl = (MacSpi)spiImpl.clone();
    Mac mac = new Mac(newSpiImpl, this.provider, this.algorithm);
    mac.isInitMac = this.isInitMac;
    return mac;
  }
}

代码示例来源:origin: ibinti/bugvm

/**
   * Clones this {@code Mac} instance and the underlying implementation.
   *
   * @return the cloned instance.
   * @throws CloneNotSupportedException
   *             if the underlying implementation does not support cloning.
   */
  @Override
  public final Object clone() throws CloneNotSupportedException {
    MacSpi newSpiImpl = (MacSpi)spiImpl.clone();
    Mac mac = new Mac(newSpiImpl, this.provider, this.algorithm);
    mac.isInitMac = this.isInitMac;
    return mac;
  }
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
   * Clones this {@code Mac} instance and the underlying implementation.
   *
   * @return the cloned instance.
   * @throws CloneNotSupportedException
   *             if the underlying implementation does not support cloning.
   */
  @Override
  public final Object clone() throws CloneNotSupportedException {
    MacSpi newSpiImpl = (MacSpi)spiImpl.clone();
    Mac mac = new Mac(newSpiImpl, this.provider, this.algorithm);
    mac.isInitMac = this.isInitMac;
    return mac;
  }
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
   * Clones this {@code Mac} instance and the underlying implementation.
   *
   * @return the cloned instance.
   * @throws CloneNotSupportedException
   *             if the underlying implementation does not support cloning.
   */
  @Override
  public final Object clone() throws CloneNotSupportedException {
    MacSpi newSpiImpl = (MacSpi)spiImpl.clone();
    Mac mac = new Mac(newSpiImpl, this.provider, this.algorithm);
    mac.isInitMac = this.isInitMac;
    return mac;
  }
}

代码示例来源:origin: FlexoVM/flexovm

/**
   * Clones this {@code Mac} instance and the underlying implementation.
   *
   * @return the cloned instance.
   * @throws CloneNotSupportedException
   *             if the underlying implementation does not support cloning.
   */
  @Override
  public final Object clone() throws CloneNotSupportedException {
    MacSpi newSpiImpl = (MacSpi)spiImpl.clone();
    Mac mac = new Mac(newSpiImpl, this.provider, this.algorithm);
    mac.isInitMac = this.isInitMac;
    return mac;
  }
}

代码示例来源:origin: MobiVM/robovm

/**
 * Creates a new {@code Mac} instance that provides the specified MAC
 * algorithm.
 *
 * @param algorithm
 *            the name of the requested MAC algorithm.
 * @return the new {@code Mac} instance.
 * @throws NoSuchAlgorithmException
 *             if the specified algorithm is not available by any provider.
 * @throws NullPointerException
 *             if {@code algorithm} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release).
 */
public static final Mac getInstance(String algorithm)
    throws NoSuchAlgorithmException {
  if (algorithm == null) {
    throw new NullPointerException("algorithm == null");
  }
  Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null);
  return new Mac((MacSpi) sap.spi, sap.provider, algorithm);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Creates a new {@code Mac} instance that provides the specified MAC
 * algorithm.
 *
 * @param algorithm
 *            the name of the requested MAC algorithm.
 * @return the new {@code Mac} instance.
 * @throws NoSuchAlgorithmException
 *             if the specified algorithm is not available by any provider.
 * @throws NullPointerException
 *             if {@code algorithm} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release).
 */
public static final Mac getInstance(String algorithm)
    throws NoSuchAlgorithmException {
  if (algorithm == null) {
    throw new NullPointerException("algorithm == null");
  }
  Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null);
  return new Mac((MacSpi) sap.spi, sap.provider, algorithm);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Creates a new {@code Mac} instance that provides the specified MAC
 * algorithm.
 *
 * @param algorithm
 *            the name of the requested MAC algorithm.
 * @return the new {@code Mac} instance.
 * @throws NoSuchAlgorithmException
 *             if the specified algorithm is not available by any provider.
 * @throws NullPointerException
 *             if {@code algorithm} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release).
 */
public static final Mac getInstance(String algorithm)
    throws NoSuchAlgorithmException {
  if (algorithm == null) {
    throw new NullPointerException("algorithm == null");
  }
  Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null);
  return new Mac((MacSpi) sap.spi, sap.provider, algorithm);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Creates a new {@code Mac} instance that provides the specified MAC
 * algorithm.
 *
 * @param algorithm
 *            the name of the requested MAC algorithm.
 * @return the new {@code Mac} instance.
 * @throws NoSuchAlgorithmException
 *             if the specified algorithm is not available by any provider.
 * @throws NullPointerException
 *             if {@code algorithm} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release).
 */
public static final Mac getInstance(String algorithm)
    throws NoSuchAlgorithmException {
  if (algorithm == null) {
    throw new NullPointerException("algorithm == null");
  }
  Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null);
  return new Mac((MacSpi) sap.spi, sap.provider, algorithm);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Creates a new {@code Mac} instance that provides the specified MAC
 * algorithm.
 *
 * @param algorithm
 *            the name of the requested MAC algorithm.
 * @return the new {@code Mac} instance.
 * @throws NoSuchAlgorithmException
 *             if the specified algorithm is not available by any provider.
 * @throws NullPointerException
 *             if {@code algorithm} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release).
 */
public static final Mac getInstance(String algorithm)
    throws NoSuchAlgorithmException {
  if (algorithm == null) {
    throw new NullPointerException("algorithm == null");
  }
  Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null);
  return new Mac((MacSpi) sap.spi, sap.provider, algorithm);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Creates a new {@code Mac} instance that provides the specified MAC
 * algorithm.
 *
 * @param algorithm
 *            the name of the requested MAC algorithm.
 * @return the new {@code Mac} instance.
 * @throws NoSuchAlgorithmException
 *             if the specified algorithm is not available by any provider.
 * @throws NullPointerException
 *             if {@code algorithm} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release).
 */
public static final Mac getInstance(String algorithm)
    throws NoSuchAlgorithmException {
  if (algorithm == null) {
    throw new NullPointerException("algorithm == null");
  }
  Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null);
  return new Mac((MacSpi) sap.spi, sap.provider, algorithm);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Creates a new {@code Mac} instance that provides the specified MAC
 * algorithm from the specified provider.
 *
 * @param algorithm
 *            the name of the requested MAC algorithm.
 * @param provider
 *            the provider that is providing the algorithm.
 * @return the new {@code Mac} instance.
 * @throws NoSuchAlgorithmException
 *             if the specified algorithm is not provided by the specified
 *             provider.
 * @throws IllegalArgumentException
 *             if {@code provider} is {@code null}.
 * @throws NullPointerException
 *             if {@code algorithm} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release).
 */
public static final Mac getInstance(String algorithm, Provider provider)
    throws NoSuchAlgorithmException {
  if (provider == null) {
    throw new IllegalArgumentException("provider == null");
  }
  if (algorithm == null) {
    throw new NullPointerException("algorithm == null");
  }
  Object spi = ENGINE.getInstance(algorithm, provider, null);
  return new Mac((MacSpi) spi, provider, algorithm);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Creates a new {@code Mac} instance that provides the specified MAC
 * algorithm from the specified provider.
 *
 * @param algorithm
 *            the name of the requested MAC algorithm.
 * @param provider
 *            the provider that is providing the algorithm.
 * @return the new {@code Mac} instance.
 * @throws NoSuchAlgorithmException
 *             if the specified algorithm is not provided by the specified
 *             provider.
 * @throws IllegalArgumentException
 *             if {@code provider} is {@code null}.
 * @throws NullPointerException
 *             if {@code algorithm} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release).
 */
public static final Mac getInstance(String algorithm, Provider provider)
    throws NoSuchAlgorithmException {
  if (provider == null) {
    throw new IllegalArgumentException("provider == null");
  }
  if (algorithm == null) {
    throw new NullPointerException("algorithm == null");
  }
  Object spi = ENGINE.getInstance(algorithm, provider, null);
  return new Mac((MacSpi) spi, provider, algorithm);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Creates a new {@code Mac} instance that provides the specified MAC
 * algorithm from the specified provider.
 *
 * @param algorithm
 *            the name of the requested MAC algorithm.
 * @param provider
 *            the provider that is providing the algorithm.
 * @return the new {@code Mac} instance.
 * @throws NoSuchAlgorithmException
 *             if the specified algorithm is not provided by the specified
 *             provider.
 * @throws IllegalArgumentException
 *             if {@code provider} is {@code null}.
 * @throws NullPointerException
 *             if {@code algorithm} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release).
 */
public static final Mac getInstance(String algorithm, Provider provider)
    throws NoSuchAlgorithmException {
  if (provider == null) {
    throw new IllegalArgumentException("provider == null");
  }
  if (algorithm == null) {
    throw new NullPointerException("algorithm == null");
  }
  Object spi = ENGINE.getInstance(algorithm, provider, null);
  return new Mac((MacSpi) spi, provider, algorithm);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Creates a new {@code Mac} instance that provides the specified MAC
 * algorithm from the specified provider.
 *
 * @param algorithm
 *            the name of the requested MAC algorithm.
 * @param provider
 *            the provider that is providing the algorithm.
 * @return the new {@code Mac} instance.
 * @throws NoSuchAlgorithmException
 *             if the specified algorithm is not provided by the specified
 *             provider.
 * @throws IllegalArgumentException
 *             if {@code provider} is {@code null}.
 * @throws NullPointerException
 *             if {@code algorithm} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release).
 */
public static final Mac getInstance(String algorithm, Provider provider)
    throws NoSuchAlgorithmException {
  if (provider == null) {
    throw new IllegalArgumentException("provider == null");
  }
  if (algorithm == null) {
    throw new NullPointerException("algorithm == null");
  }
  Object spi = ENGINE.getInstance(algorithm, provider, null);
  return new Mac((MacSpi) spi, provider, algorithm);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Creates a new {@code Mac} instance that provides the specified MAC
 * algorithm from the specified provider.
 *
 * @param algorithm
 *            the name of the requested MAC algorithm.
 * @param provider
 *            the provider that is providing the algorithm.
 * @return the new {@code Mac} instance.
 * @throws NoSuchAlgorithmException
 *             if the specified algorithm is not provided by the specified
 *             provider.
 * @throws IllegalArgumentException
 *             if {@code provider} is {@code null}.
 * @throws NullPointerException
 *             if {@code algorithm} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release).
 */
public static final Mac getInstance(String algorithm, Provider provider)
    throws NoSuchAlgorithmException {
  if (provider == null) {
    throw new IllegalArgumentException("provider == null");
  }
  if (algorithm == null) {
    throw new NullPointerException("algorithm == null");
  }
  Object spi = ENGINE.getInstance(algorithm, provider, null);
  return new Mac((MacSpi) spi, provider, algorithm);
}

相关文章