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

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

本文整理了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

  1. /**
  2. * Clones this {@code Mac} instance and the underlying implementation.
  3. *
  4. * @return the cloned instance.
  5. * @throws CloneNotSupportedException
  6. * if the underlying implementation does not support cloning.
  7. */
  8. @Override
  9. public final Object clone() throws CloneNotSupportedException {
  10. MacSpi newSpiImpl = (MacSpi)spiImpl.clone();
  11. Mac mac = new Mac(newSpiImpl, this.provider, this.algorithm);
  12. mac.isInitMac = this.isInitMac;
  13. return mac;
  14. }
  15. }

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

  1. /**
  2. * Creates a new {@code Mac} instance that provides the specified MAC
  3. * algorithm.
  4. *
  5. * @param algorithm
  6. * the name of the requested MAC algorithm.
  7. * @return the new {@code Mac} instance.
  8. * @throws NoSuchAlgorithmException
  9. * if the specified algorithm is not available by any provider.
  10. * @throws NullPointerException
  11. * if {@code algorithm} is {@code null} (instead of
  12. * NoSuchAlgorithmException as in 1.4 release).
  13. */
  14. public static final Mac getInstance(String algorithm)
  15. throws NoSuchAlgorithmException {
  16. if (algorithm == null) {
  17. throw new NullPointerException("algorithm == null");
  18. }
  19. Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null);
  20. return new Mac((MacSpi) sap.spi, sap.provider, algorithm);
  21. }

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

  1. /**
  2. * Creates a new {@code Mac} instance that provides the specified MAC
  3. * algorithm from the specified provider.
  4. *
  5. * @param algorithm
  6. * the name of the requested MAC algorithm.
  7. * @param provider
  8. * the provider that is providing the algorithm.
  9. * @return the new {@code Mac} instance.
  10. * @throws NoSuchAlgorithmException
  11. * if the specified algorithm is not provided by the specified
  12. * provider.
  13. * @throws IllegalArgumentException
  14. * if {@code provider} is {@code null}.
  15. * @throws NullPointerException
  16. * if {@code algorithm} is {@code null} (instead of
  17. * NoSuchAlgorithmException as in 1.4 release).
  18. */
  19. public static final Mac getInstance(String algorithm, Provider provider)
  20. throws NoSuchAlgorithmException {
  21. if (provider == null) {
  22. throw new IllegalArgumentException("provider == null");
  23. }
  24. if (algorithm == null) {
  25. throw new NullPointerException("algorithm == null");
  26. }
  27. Object spi = ENGINE.getInstance(algorithm, provider, null);
  28. return new Mac((MacSpi) spi, provider, algorithm);
  29. }

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

  1. /**
  2. * Clones this {@code Mac} instance and the underlying implementation.
  3. *
  4. * @return the cloned instance.
  5. * @throws CloneNotSupportedException
  6. * if the underlying implementation does not support cloning.
  7. */
  8. @Override
  9. public final Object clone() throws CloneNotSupportedException {
  10. MacSpi newSpiImpl = (MacSpi)spiImpl.clone();
  11. Mac mac = new Mac(newSpiImpl, this.provider, this.algorithm);
  12. mac.isInitMac = this.isInitMac;
  13. return mac;
  14. }
  15. }

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

  1. /**
  2. * Clones this {@code Mac} instance and the underlying implementation.
  3. *
  4. * @return the cloned instance.
  5. * @throws CloneNotSupportedException
  6. * if the underlying implementation does not support cloning.
  7. */
  8. @Override
  9. public final Object clone() throws CloneNotSupportedException {
  10. MacSpi newSpiImpl = (MacSpi)spiImpl.clone();
  11. Mac mac = new Mac(newSpiImpl, this.provider, this.algorithm);
  12. mac.isInitMac = this.isInitMac;
  13. return mac;
  14. }
  15. }

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

  1. /**
  2. * Clones this {@code Mac} instance and the underlying implementation.
  3. *
  4. * @return the cloned instance.
  5. * @throws CloneNotSupportedException
  6. * if the underlying implementation does not support cloning.
  7. */
  8. @Override
  9. public final Object clone() throws CloneNotSupportedException {
  10. MacSpi newSpiImpl = (MacSpi)spiImpl.clone();
  11. Mac mac = new Mac(newSpiImpl, this.provider, this.algorithm);
  12. mac.isInitMac = this.isInitMac;
  13. return mac;
  14. }
  15. }

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

  1. /**
  2. * Clones this {@code Mac} instance and the underlying implementation.
  3. *
  4. * @return the cloned instance.
  5. * @throws CloneNotSupportedException
  6. * if the underlying implementation does not support cloning.
  7. */
  8. @Override
  9. public final Object clone() throws CloneNotSupportedException {
  10. MacSpi newSpiImpl = (MacSpi)spiImpl.clone();
  11. Mac mac = new Mac(newSpiImpl, this.provider, this.algorithm);
  12. mac.isInitMac = this.isInitMac;
  13. return mac;
  14. }
  15. }

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

  1. /**
  2. * Clones this {@code Mac} instance and the underlying implementation.
  3. *
  4. * @return the cloned instance.
  5. * @throws CloneNotSupportedException
  6. * if the underlying implementation does not support cloning.
  7. */
  8. @Override
  9. public final Object clone() throws CloneNotSupportedException {
  10. MacSpi newSpiImpl = (MacSpi)spiImpl.clone();
  11. Mac mac = new Mac(newSpiImpl, this.provider, this.algorithm);
  12. mac.isInitMac = this.isInitMac;
  13. return mac;
  14. }
  15. }

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

  1. /**
  2. * Clones this {@code Mac} instance and the underlying implementation.
  3. *
  4. * @return the cloned instance.
  5. * @throws CloneNotSupportedException
  6. * if the underlying implementation does not support cloning.
  7. */
  8. @Override
  9. public final Object clone() throws CloneNotSupportedException {
  10. MacSpi newSpiImpl = (MacSpi)spiImpl.clone();
  11. Mac mac = new Mac(newSpiImpl, this.provider, this.algorithm);
  12. mac.isInitMac = this.isInitMac;
  13. return mac;
  14. }
  15. }

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

  1. /**
  2. * Creates a new {@code Mac} instance that provides the specified MAC
  3. * algorithm.
  4. *
  5. * @param algorithm
  6. * the name of the requested MAC algorithm.
  7. * @return the new {@code Mac} instance.
  8. * @throws NoSuchAlgorithmException
  9. * if the specified algorithm is not available by any provider.
  10. * @throws NullPointerException
  11. * if {@code algorithm} is {@code null} (instead of
  12. * NoSuchAlgorithmException as in 1.4 release).
  13. */
  14. public static final Mac getInstance(String algorithm)
  15. throws NoSuchAlgorithmException {
  16. if (algorithm == null) {
  17. throw new NullPointerException("algorithm == null");
  18. }
  19. Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null);
  20. return new Mac((MacSpi) sap.spi, sap.provider, algorithm);
  21. }

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

  1. /**
  2. * Creates a new {@code Mac} instance that provides the specified MAC
  3. * algorithm.
  4. *
  5. * @param algorithm
  6. * the name of the requested MAC algorithm.
  7. * @return the new {@code Mac} instance.
  8. * @throws NoSuchAlgorithmException
  9. * if the specified algorithm is not available by any provider.
  10. * @throws NullPointerException
  11. * if {@code algorithm} is {@code null} (instead of
  12. * NoSuchAlgorithmException as in 1.4 release).
  13. */
  14. public static final Mac getInstance(String algorithm)
  15. throws NoSuchAlgorithmException {
  16. if (algorithm == null) {
  17. throw new NullPointerException("algorithm == null");
  18. }
  19. Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null);
  20. return new Mac((MacSpi) sap.spi, sap.provider, algorithm);
  21. }

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

  1. /**
  2. * Creates a new {@code Mac} instance that provides the specified MAC
  3. * algorithm.
  4. *
  5. * @param algorithm
  6. * the name of the requested MAC algorithm.
  7. * @return the new {@code Mac} instance.
  8. * @throws NoSuchAlgorithmException
  9. * if the specified algorithm is not available by any provider.
  10. * @throws NullPointerException
  11. * if {@code algorithm} is {@code null} (instead of
  12. * NoSuchAlgorithmException as in 1.4 release).
  13. */
  14. public static final Mac getInstance(String algorithm)
  15. throws NoSuchAlgorithmException {
  16. if (algorithm == null) {
  17. throw new NullPointerException("algorithm == null");
  18. }
  19. Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null);
  20. return new Mac((MacSpi) sap.spi, sap.provider, algorithm);
  21. }

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

  1. /**
  2. * Creates a new {@code Mac} instance that provides the specified MAC
  3. * algorithm.
  4. *
  5. * @param algorithm
  6. * the name of the requested MAC algorithm.
  7. * @return the new {@code Mac} instance.
  8. * @throws NoSuchAlgorithmException
  9. * if the specified algorithm is not available by any provider.
  10. * @throws NullPointerException
  11. * if {@code algorithm} is {@code null} (instead of
  12. * NoSuchAlgorithmException as in 1.4 release).
  13. */
  14. public static final Mac getInstance(String algorithm)
  15. throws NoSuchAlgorithmException {
  16. if (algorithm == null) {
  17. throw new NullPointerException("algorithm == null");
  18. }
  19. Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null);
  20. return new Mac((MacSpi) sap.spi, sap.provider, algorithm);
  21. }

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

  1. /**
  2. * Creates a new {@code Mac} instance that provides the specified MAC
  3. * algorithm.
  4. *
  5. * @param algorithm
  6. * the name of the requested MAC algorithm.
  7. * @return the new {@code Mac} instance.
  8. * @throws NoSuchAlgorithmException
  9. * if the specified algorithm is not available by any provider.
  10. * @throws NullPointerException
  11. * if {@code algorithm} is {@code null} (instead of
  12. * NoSuchAlgorithmException as in 1.4 release).
  13. */
  14. public static final Mac getInstance(String algorithm)
  15. throws NoSuchAlgorithmException {
  16. if (algorithm == null) {
  17. throw new NullPointerException("algorithm == null");
  18. }
  19. Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null);
  20. return new Mac((MacSpi) sap.spi, sap.provider, algorithm);
  21. }

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

  1. /**
  2. * Creates a new {@code Mac} instance that provides the specified MAC
  3. * algorithm.
  4. *
  5. * @param algorithm
  6. * the name of the requested MAC algorithm.
  7. * @return the new {@code Mac} instance.
  8. * @throws NoSuchAlgorithmException
  9. * if the specified algorithm is not available by any provider.
  10. * @throws NullPointerException
  11. * if {@code algorithm} is {@code null} (instead of
  12. * NoSuchAlgorithmException as in 1.4 release).
  13. */
  14. public static final Mac getInstance(String algorithm)
  15. throws NoSuchAlgorithmException {
  16. if (algorithm == null) {
  17. throw new NullPointerException("algorithm == null");
  18. }
  19. Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null);
  20. return new Mac((MacSpi) sap.spi, sap.provider, algorithm);
  21. }

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

  1. /**
  2. * Creates a new {@code Mac} instance that provides the specified MAC
  3. * algorithm from the specified provider.
  4. *
  5. * @param algorithm
  6. * the name of the requested MAC algorithm.
  7. * @param provider
  8. * the provider that is providing the algorithm.
  9. * @return the new {@code Mac} instance.
  10. * @throws NoSuchAlgorithmException
  11. * if the specified algorithm is not provided by the specified
  12. * provider.
  13. * @throws IllegalArgumentException
  14. * if {@code provider} is {@code null}.
  15. * @throws NullPointerException
  16. * if {@code algorithm} is {@code null} (instead of
  17. * NoSuchAlgorithmException as in 1.4 release).
  18. */
  19. public static final Mac getInstance(String algorithm, Provider provider)
  20. throws NoSuchAlgorithmException {
  21. if (provider == null) {
  22. throw new IllegalArgumentException("provider == null");
  23. }
  24. if (algorithm == null) {
  25. throw new NullPointerException("algorithm == null");
  26. }
  27. Object spi = ENGINE.getInstance(algorithm, provider, null);
  28. return new Mac((MacSpi) spi, provider, algorithm);
  29. }

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

  1. /**
  2. * Creates a new {@code Mac} instance that provides the specified MAC
  3. * algorithm from the specified provider.
  4. *
  5. * @param algorithm
  6. * the name of the requested MAC algorithm.
  7. * @param provider
  8. * the provider that is providing the algorithm.
  9. * @return the new {@code Mac} instance.
  10. * @throws NoSuchAlgorithmException
  11. * if the specified algorithm is not provided by the specified
  12. * provider.
  13. * @throws IllegalArgumentException
  14. * if {@code provider} is {@code null}.
  15. * @throws NullPointerException
  16. * if {@code algorithm} is {@code null} (instead of
  17. * NoSuchAlgorithmException as in 1.4 release).
  18. */
  19. public static final Mac getInstance(String algorithm, Provider provider)
  20. throws NoSuchAlgorithmException {
  21. if (provider == null) {
  22. throw new IllegalArgumentException("provider == null");
  23. }
  24. if (algorithm == null) {
  25. throw new NullPointerException("algorithm == null");
  26. }
  27. Object spi = ENGINE.getInstance(algorithm, provider, null);
  28. return new Mac((MacSpi) spi, provider, algorithm);
  29. }

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

  1. /**
  2. * Creates a new {@code Mac} instance that provides the specified MAC
  3. * algorithm from the specified provider.
  4. *
  5. * @param algorithm
  6. * the name of the requested MAC algorithm.
  7. * @param provider
  8. * the provider that is providing the algorithm.
  9. * @return the new {@code Mac} instance.
  10. * @throws NoSuchAlgorithmException
  11. * if the specified algorithm is not provided by the specified
  12. * provider.
  13. * @throws IllegalArgumentException
  14. * if {@code provider} is {@code null}.
  15. * @throws NullPointerException
  16. * if {@code algorithm} is {@code null} (instead of
  17. * NoSuchAlgorithmException as in 1.4 release).
  18. */
  19. public static final Mac getInstance(String algorithm, Provider provider)
  20. throws NoSuchAlgorithmException {
  21. if (provider == null) {
  22. throw new IllegalArgumentException("provider == null");
  23. }
  24. if (algorithm == null) {
  25. throw new NullPointerException("algorithm == null");
  26. }
  27. Object spi = ENGINE.getInstance(algorithm, provider, null);
  28. return new Mac((MacSpi) spi, provider, algorithm);
  29. }

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

  1. /**
  2. * Creates a new {@code Mac} instance that provides the specified MAC
  3. * algorithm from the specified provider.
  4. *
  5. * @param algorithm
  6. * the name of the requested MAC algorithm.
  7. * @param provider
  8. * the provider that is providing the algorithm.
  9. * @return the new {@code Mac} instance.
  10. * @throws NoSuchAlgorithmException
  11. * if the specified algorithm is not provided by the specified
  12. * provider.
  13. * @throws IllegalArgumentException
  14. * if {@code provider} is {@code null}.
  15. * @throws NullPointerException
  16. * if {@code algorithm} is {@code null} (instead of
  17. * NoSuchAlgorithmException as in 1.4 release).
  18. */
  19. public static final Mac getInstance(String algorithm, Provider provider)
  20. throws NoSuchAlgorithmException {
  21. if (provider == null) {
  22. throw new IllegalArgumentException("provider == null");
  23. }
  24. if (algorithm == null) {
  25. throw new NullPointerException("algorithm == null");
  26. }
  27. Object spi = ENGINE.getInstance(algorithm, provider, null);
  28. return new Mac((MacSpi) spi, provider, algorithm);
  29. }

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

  1. /**
  2. * Creates a new {@code Mac} instance that provides the specified MAC
  3. * algorithm from the specified provider.
  4. *
  5. * @param algorithm
  6. * the name of the requested MAC algorithm.
  7. * @param provider
  8. * the provider that is providing the algorithm.
  9. * @return the new {@code Mac} instance.
  10. * @throws NoSuchAlgorithmException
  11. * if the specified algorithm is not provided by the specified
  12. * provider.
  13. * @throws IllegalArgumentException
  14. * if {@code provider} is {@code null}.
  15. * @throws NullPointerException
  16. * if {@code algorithm} is {@code null} (instead of
  17. * NoSuchAlgorithmException as in 1.4 release).
  18. */
  19. public static final Mac getInstance(String algorithm, Provider provider)
  20. throws NoSuchAlgorithmException {
  21. if (provider == null) {
  22. throw new IllegalArgumentException("provider == null");
  23. }
  24. if (algorithm == null) {
  25. throw new NullPointerException("algorithm == null");
  26. }
  27. Object spi = ENGINE.getInstance(algorithm, provider, null);
  28. return new Mac((MacSpi) spi, provider, algorithm);
  29. }

相关文章