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

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

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

Cipher.getCipher介绍

[英]Find appropriate Cipher according the specification rules
[中]根据规范规则找到合适的密码

代码示例

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

/**
 * Creates a new Cipher for the specified transformation. The installed
 * providers are searched in order for an implementation of the specified
 * transformation. The first found provider providing the transformation is
 * used to create the cipher. If no provider is found an exception is
 * thrown.
 *
 * @param transformation
 *            the name of the transformation to create a cipher for.
 * @return a cipher for the requested transformation.
 * @throws NoSuchAlgorithmException
 *             if no installed provider can provide the
 *             <i>transformation</i>, or it is {@code null}, empty or in an
 *             invalid format.
 * @throws NoSuchPaddingException
 *             if no installed provider can provide the padding scheme in
 *             the <i>transformation</i>.
 */
public static final Cipher getInstance(String transformation)
    throws NoSuchAlgorithmException, NoSuchPaddingException {
  return getCipher(transformation, null);
}

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

/**
 * Creates a new cipher for the specified transformation.
 *
 * @param transformation
 *            the name of the transformation to create a cipher for.
 * @param provider
 *            the provider to ask for the transformation.
 * @return a cipher for the requested transformation.
 * @throws NoSuchAlgorithmException
 *             if the specified provider can not provide the
 *             <i>transformation</i>, or it is {@code null}, empty or in an
 *             invalid format.
 * @throws NoSuchPaddingException
 *             if the requested padding scheme in the <i>transformation</i>
 *             is not available.
 * @throws IllegalArgumentException
 *             if the provider is {@code null}.
 */
public static final Cipher getInstance(String transformation,
    Provider provider) throws NoSuchAlgorithmException,
    NoSuchPaddingException {
  if (provider == null) {
    throw new IllegalArgumentException("provider == null");
  }
  Cipher c = getCipher(transformation, provider);
  return c;
}

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

/**
 * Creates a new Cipher for the specified transformation. The installed
 * providers are searched in order for an implementation of the specified
 * transformation. The first found provider providing the transformation is
 * used to create the cipher. If no provider is found an exception is
 * thrown.
 *
 * @param transformation
 *            the name of the transformation to create a cipher for.
 * @return a cipher for the requested transformation.
 * @throws NoSuchAlgorithmException
 *             if no installed provider can provide the
 *             <i>transformation</i>, or it is {@code null}, empty or in an
 *             invalid format.
 * @throws NoSuchPaddingException
 *             if no installed provider can provide the padding scheme in
 *             the <i>transformation</i>.
 */
public static final Cipher getInstance(String transformation)
    throws NoSuchAlgorithmException, NoSuchPaddingException {
  return getCipher(transformation, null);
}

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

/**
 * Creates a new Cipher for the specified transformation. The installed
 * providers are searched in order for an implementation of the specified
 * transformation. The first found provider providing the transformation is
 * used to create the cipher. If no provider is found an exception is
 * thrown.
 *
 * @param transformation
 *            the name of the transformation to create a cipher for.
 * @return a cipher for the requested transformation.
 * @throws NoSuchAlgorithmException
 *             if no installed provider can provide the
 *             <i>transformation</i>, or it is {@code null}, empty or in an
 *             invalid format.
 * @throws NoSuchPaddingException
 *             if no installed provider can provide the padding scheme in
 *             the <i>transformation</i>.
 */
public static final Cipher getInstance(String transformation)
    throws NoSuchAlgorithmException, NoSuchPaddingException {
  return getCipher(transformation, null);
}

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

/**
 * Creates a new Cipher for the specified transformation. The installed
 * providers are searched in order for an implementation of the specified
 * transformation. The first found provider providing the transformation is
 * used to create the cipher. If no provider is found an exception is
 * thrown.
 *
 * @param transformation
 *            the name of the transformation to create a cipher for.
 * @return a cipher for the requested transformation.
 * @throws NoSuchAlgorithmException
 *             if no installed provider can provide the
 *             <i>transformation</i>, or it is {@code null}, empty or in an
 *             invalid format.
 * @throws NoSuchPaddingException
 *             if no installed provider can provide the padding scheme in
 *             the <i>transformation</i>.
 */
public static final Cipher getInstance(String transformation)
    throws NoSuchAlgorithmException, NoSuchPaddingException {
  return getCipher(transformation, null);
}

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

/**
 * Creates a new Cipher for the specified transformation. The installed
 * providers are searched in order for an implementation of the specified
 * transformation. The first found provider providing the transformation is
 * used to create the cipher. If no provider is found an exception is
 * thrown.
 *
 * @param transformation
 *            the name of the transformation to create a cipher for.
 * @return a cipher for the requested transformation.
 * @throws NoSuchAlgorithmException
 *             if no installed provider can provide the
 *             <i>transformation</i>, or it is {@code null}, empty or in an
 *             invalid format.
 * @throws NoSuchPaddingException
 *             if no installed provider can provide the padding scheme in
 *             the <i>transformation</i>.
 */
public static final Cipher getInstance(String transformation)
    throws NoSuchAlgorithmException, NoSuchPaddingException {
  return getCipher(transformation, null);
}

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

/**
 * Creates a new Cipher for the specified transformation. The installed
 * providers are searched in order for an implementation of the specified
 * transformation. The first found provider providing the transformation is
 * used to create the cipher. If no provider is found an exception is
 * thrown.
 *
 * @param transformation
 *            the name of the transformation to create a cipher for.
 * @return a cipher for the requested transformation.
 * @throws NoSuchAlgorithmException
 *             if no installed provider can provide the
 *             <i>transformation</i>, or it is {@code null}, empty or in an
 *             invalid format.
 * @throws NoSuchPaddingException
 *             if no installed provider can provide the padding scheme in
 *             the <i>transformation</i>.
 */
public static final Cipher getInstance(String transformation)
    throws NoSuchAlgorithmException, NoSuchPaddingException {
  return getCipher(transformation, null);
}

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

/**
 * Creates a new Cipher for the specified transformation. The installed
 * providers are searched in order for an implementation of the specified
 * transformation. The first found provider providing the transformation is
 * used to create the cipher. If no provider is found an exception is
 * thrown.
 *
 * @param transformation
 *            the name of the transformation to create a cipher for.
 * @return a cipher for the requested transformation.
 * @throws NoSuchAlgorithmException
 *             if no installed provider can provide the
 *             <i>transformation</i>, or it is {@code null}, empty or in an
 *             invalid format.
 * @throws NoSuchPaddingException
 *             if no installed provider can provide the padding scheme in
 *             the <i>transformation</i>.
 */
public static final Cipher getInstance(String transformation)
    throws NoSuchAlgorithmException, NoSuchPaddingException {
  return getCipher(transformation, null);
}

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

/**
 * Creates a new cipher for the specified transformation.
 *
 * @param transformation
 *            the name of the transformation to create a cipher for.
 * @param provider
 *            the provider to ask for the transformation.
 * @return a cipher for the requested transformation.
 * @throws NoSuchAlgorithmException
 *             if the specified provider can not provide the
 *             <i>transformation</i>, or it is {@code null}, empty or in an
 *             invalid format.
 * @throws NoSuchPaddingException
 *             if the requested padding scheme in the <i>transformation</i>
 *             is not available.
 * @throws IllegalArgumentException
 *             if the provider is {@code null}.
 */
public static final Cipher getInstance(String transformation,
    Provider provider) throws NoSuchAlgorithmException,
    NoSuchPaddingException {
  if (provider == null) {
    throw new IllegalArgumentException("provider == null");
  }
  Cipher c = getCipher(transformation, provider);
  return c;
}

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

/**
 * Creates a new cipher for the specified transformation.
 *
 * @param transformation
 *            the name of the transformation to create a cipher for.
 * @param provider
 *            the provider to ask for the transformation.
 * @return a cipher for the requested transformation.
 * @throws NoSuchAlgorithmException
 *             if the specified provider can not provide the
 *             <i>transformation</i>, or it is {@code null}, empty or in an
 *             invalid format.
 * @throws NoSuchPaddingException
 *             if the requested padding scheme in the <i>transformation</i>
 *             is not available.
 * @throws IllegalArgumentException
 *             if the provider is {@code null}.
 */
public static final Cipher getInstance(String transformation,
    Provider provider) throws NoSuchAlgorithmException,
    NoSuchPaddingException {
  if (provider == null) {
    throw new IllegalArgumentException("provider == null");
  }
  Cipher c = getCipher(transformation, provider);
  return c;
}

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

/**
 * Creates a new cipher for the specified transformation.
 *
 * @param transformation
 *            the name of the transformation to create a cipher for.
 * @param provider
 *            the provider to ask for the transformation.
 * @return a cipher for the requested transformation.
 * @throws NoSuchAlgorithmException
 *             if the specified provider can not provide the
 *             <i>transformation</i>, or it is {@code null}, empty or in an
 *             invalid format.
 * @throws NoSuchPaddingException
 *             if the requested padding scheme in the <i>transformation</i>
 *             is not available.
 * @throws IllegalArgumentException
 *             if the provider is {@code null}.
 */
public static final Cipher getInstance(String transformation,
    Provider provider) throws NoSuchAlgorithmException,
    NoSuchPaddingException {
  if (provider == null) {
    throw new IllegalArgumentException("provider == null");
  }
  Cipher c = getCipher(transformation, provider);
  return c;
}

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

/**
 * Creates a new cipher for the specified transformation.
 *
 * @param transformation
 *            the name of the transformation to create a cipher for.
 * @param provider
 *            the provider to ask for the transformation.
 * @return a cipher for the requested transformation.
 * @throws NoSuchAlgorithmException
 *             if the specified provider can not provide the
 *             <i>transformation</i>, or it is {@code null}, empty or in an
 *             invalid format.
 * @throws NoSuchPaddingException
 *             if the requested padding scheme in the <i>transformation</i>
 *             is not available.
 * @throws IllegalArgumentException
 *             if the provider is {@code null}.
 */
public static final Cipher getInstance(String transformation,
    Provider provider) throws NoSuchAlgorithmException,
    NoSuchPaddingException {
  if (provider == null) {
    throw new IllegalArgumentException("provider == null");
  }
  Cipher c = getCipher(transformation, provider);
  return c;
}

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

/**
 * Creates a new cipher for the specified transformation.
 *
 * @param transformation
 *            the name of the transformation to create a cipher for.
 * @param provider
 *            the provider to ask for the transformation.
 * @return a cipher for the requested transformation.
 * @throws NoSuchAlgorithmException
 *             if the specified provider can not provide the
 *             <i>transformation</i>, or it is {@code null}, empty or in an
 *             invalid format.
 * @throws NoSuchPaddingException
 *             if the requested padding scheme in the <i>transformation</i>
 *             is not available.
 * @throws IllegalArgumentException
 *             if the provider is {@code null}.
 */
public static final Cipher getInstance(String transformation,
    Provider provider) throws NoSuchAlgorithmException,
    NoSuchPaddingException {
  if (provider == null) {
    throw new IllegalArgumentException("provider == null");
  }
  Cipher c = getCipher(transformation, provider);
  return c;
}

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

/**
 * Creates a new cipher for the specified transformation.
 *
 * @param transformation
 *            the name of the transformation to create a cipher for.
 * @param provider
 *            the provider to ask for the transformation.
 * @return a cipher for the requested transformation.
 * @throws NoSuchAlgorithmException
 *             if the specified provider can not provide the
 *             <i>transformation</i>, or it is {@code null}, empty or in an
 *             invalid format.
 * @throws NoSuchPaddingException
 *             if the requested padding scheme in the <i>transformation</i>
 *             is not available.
 * @throws IllegalArgumentException
 *             if the provider is {@code null}.
 */
public static final Cipher getInstance(String transformation,
    Provider provider) throws NoSuchAlgorithmException,
    NoSuchPaddingException {
  if (provider == null) {
    throw new IllegalArgumentException("provider == null");
  }
  Cipher c = getCipher(transformation, provider);
  return c;
}

相关文章