javax.crypto.Cipher.getProvider()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(201)

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

Cipher.getProvider介绍

[英]Returns the provider of this cipher instance.
[中]返回此密码实例的提供程序。

代码示例

代码示例来源:origin: aws/aws-sdk-java

/**
 * Returns the provider of the underlying cipher.
 */
final Provider getCipherProvider() {
  return cipher.getProvider();
}

代码示例来源:origin: pentaho/pentaho-kettle

public String getCipherProviderName() {
 return this.cipher.getProvider().getName();
}

代码示例来源:origin: aws/aws-sdk-java

/**
 * Creates a new instance of CipherLite from the current one, but using
 * the given IV.
 */
CipherLite createUsingIV(byte[] iv) {
  return scheme.createCipherLite(secreteKey, iv, this.cipherMode,
      cipher.getProvider(), true);
}

代码示例来源:origin: aws/aws-sdk-java

/**
 * Recreates a new instance of CipherLite from the current one.
 */
CipherLite recreate() {
  return scheme.createCipherLite(secreteKey, cipher.getIV(),
      this.cipherMode, cipher.getProvider(), true);
}

代码示例来源:origin: aws/aws-sdk-java

/**
 * Returns the inverse of the current {@link CipherLite}.
 */
CipherLite createInverse() throws InvalidKeyException,
    NoSuchAlgorithmException, NoSuchProviderException,
    NoSuchPaddingException, InvalidAlgorithmParameterException {
  int inversedMode;
  if (cipherMode == Cipher.DECRYPT_MODE)
    inversedMode = Cipher.ENCRYPT_MODE;
  else if (cipherMode == Cipher.ENCRYPT_MODE)
    inversedMode = Cipher.DECRYPT_MODE;
  else
    throw new UnsupportedOperationException();
  return scheme.createCipherLite(secreteKey, cipher.getIV(),
      inversedMode, cipher.getProvider(), true);
}

代码示例来源:origin: aws/aws-sdk-java

/**
 * Returns an auxiliary {@link CipherLite} for partial plaintext
 * re-encryption (or re-decryption) purposes.
 *
 * @param startingBytePos
 *            the starting byte position of the plaintext. Must be a
 *            multiple of the cipher block size.
 */
CipherLite createAuxiliary(long startingBytePos)
    throws InvalidKeyException, NoSuchAlgorithmException,
    NoSuchProviderException, NoSuchPaddingException,
    InvalidAlgorithmParameterException {
  return scheme.createAuxillaryCipher(secreteKey, cipher.getIV(),
      cipherMode, cipher.getProvider(), startingBytePos);
}

代码示例来源:origin: aws-amplify/aws-sdk-android

/**
 * Returns the provider of the underlying cipher.
 */
final Provider getCipherProvider() {
  return cipher.getProvider();
}

代码示例来源:origin: aws-amplify/aws-sdk-android

/**
 * Creates a new instance of CipherLite from the current one, but using
 * the given IV.
 */
CipherLite createUsingIV(byte[] iv) {
  return scheme.createCipherLite(secreteKey, iv, this.cipherMode,
      cipher.getProvider());
}

代码示例来源:origin: aws-amplify/aws-sdk-android

/**
 * Recreates a new instance of CipherLite from the current one.
 */
CipherLite recreate() {
  return scheme.createCipherLite(secreteKey, cipher.getIV(),
      this.cipherMode, cipher.getProvider());
}

代码示例来源:origin: aws-amplify/aws-sdk-android

/**
 * Returns the inverse of the current {@link CipherLite}.
 */
CipherLite createInverse() throws InvalidKeyException,
    NoSuchAlgorithmException, NoSuchProviderException,
    NoSuchPaddingException, InvalidAlgorithmParameterException {
  int inversedMode;
  if (cipherMode == Cipher.DECRYPT_MODE)
    inversedMode = Cipher.ENCRYPT_MODE;
  else if (cipherMode == Cipher.ENCRYPT_MODE)
    inversedMode = Cipher.DECRYPT_MODE;
  else
    throw new UnsupportedOperationException();
  return scheme.createCipherLite(secreteKey, cipher.getIV(),
      inversedMode, cipher.getProvider());
}

代码示例来源:origin: aws-amplify/aws-sdk-android

/**
 * Returns an auxiliary {@link CipherLite} for partial plaintext
 * re-encryption (or re-decryption) purposes.
 *
 * @param startingBytePos the starting byte position of the plaintext. Must
 *            be a multiple of the cipher block size.
 */
CipherLite createAuxiliary(long startingBytePos)
    throws InvalidKeyException, NoSuchAlgorithmException,
    NoSuchProviderException, NoSuchPaddingException,
    InvalidAlgorithmParameterException {
  return scheme.createAuxillaryCipher(secreteKey, cipher.getIV(),
      cipherMode, cipher.getProvider(), startingBytePos);
}

代码示例来源:origin: com.ibm.cos/ibm-cos-java-sdk-s3

/**
 * Returns the provider of the underlying cipher.
 */
final Provider getCipherProvider() {
  return cipher.getProvider();
}

代码示例来源:origin: org.apache.hadoop/hadoop-aws-tlnd

/**
 * Returns the provider of the underlying cipher.
 */
final Provider getCipherProvider() {
  return cipher.getProvider();
}

代码示例来源:origin: com.amazonaws/aws-android-sdk-s3

/**
 * Returns the provider of the underlying cipher.
 */
final Provider getCipherProvider() {
  return cipher.getProvider();
}

代码示例来源:origin: com.amazonaws/aws-android-sdk-s3

/**
 * Creates a new instance of CipherLite from the current one, but using
 * the given IV.
 */
CipherLite createUsingIV(byte[] iv) {
  return scheme.createCipherLite(secreteKey, iv, this.cipherMode,
      cipher.getProvider());
}

代码示例来源:origin: Nextdoor/bender

/**
 * Creates a new instance of CipherLite from the current one, but using
 * the given IV.
 */
CipherLite createUsingIV(byte[] iv) {
  return scheme.createCipherLite(secreteKey, iv, this.cipherMode,
      cipher.getProvider());
}

代码示例来源:origin: com.qcloud/cos_api

/**
 * Recreates a new instance of CipherLite from the current one.
 */
CipherLite recreate() {
  return scheme.createCipherLite(secreteKey, cipher.getIV(),
      this.cipherMode, cipher.getProvider());
}

代码示例来源:origin: tencentyun/cos-java-sdk-v5

/**
 * Recreates a new instance of CipherLite from the current one.
 */
CipherLite recreate() {
  return scheme.createCipherLite(secreteKey, cipher.getIV(),
      this.cipherMode, cipher.getProvider());
}

代码示例来源:origin: com.amazonaws/aws-android-sdk-s3

/**
 * Recreates a new instance of CipherLite from the current one.
 */
CipherLite recreate() {
  return scheme.createCipherLite(secreteKey, cipher.getIV(),
      this.cipherMode, cipher.getProvider());
}

代码示例来源:origin: org.jumpmind.symmetric/symmetric-util

protected Cipher getCipher(int mode) throws Exception {
  if (secretKey == null) {
    secretKey = getSecretKey();
  }
  Cipher cipher = Cipher.getInstance(secretKey.getAlgorithm());
  initializeCipher(cipher, mode);
  log.debug("Using {} algorithm provided by {}.", cipher.getAlgorithm(), cipher.getProvider()
      .getName());
  return cipher;
}

相关文章