本文整理了Java中javax.crypto.Cipher.invalidTransformation()
方法的一些代码示例,展示了Cipher.invalidTransformation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cipher.invalidTransformation()
方法的具体详情如下:
包路径:javax.crypto.Cipher
类名称:Cipher
方法名:invalidTransformation
暂无
代码示例来源:origin: robovm/robovm
private static String[] checkTransformation(String transformation) throws NoSuchAlgorithmException {
// ignore an extra prefix / characters such as in
// "/DES/CBC/PKCS5Paddin" http://b/3387688
if (transformation.startsWith("/")) {
transformation = transformation.substring(1);
}
// 'transformation' should be of the form "algorithm/mode/padding".
String[] pieces = transformation.split("/");
if (pieces.length > 3) {
throw invalidTransformation(transformation);
}
// Empty or missing pieces are represented by null.
String[] result = new String[3];
for (int i = 0; i < pieces.length; ++i) {
String piece = pieces[i].trim();
if (!piece.isEmpty()) {
result[i] = piece;
}
}
// You MUST specify an algorithm.
if (result[0] == null) {
throw invalidTransformation(transformation);
}
if (!(result[1] == null && result[2] == null) && (result[1] == null || result[2] == null)) {
throw invalidTransformation(transformation);
}
return result;
}
代码示例来源:origin: robovm/robovm
throw invalidTransformation(transformation);
代码示例来源:origin: com.bugvm/bugvm-rt
private static String[] checkTransformation(String transformation) throws NoSuchAlgorithmException {
// ignore an extra prefix / characters such as in
// "/DES/CBC/PKCS5Paddin" http://b/3387688
if (transformation.startsWith("/")) {
transformation = transformation.substring(1);
}
// 'transformation' should be of the form "algorithm/mode/padding".
String[] pieces = transformation.split("/");
if (pieces.length > 3) {
throw invalidTransformation(transformation);
}
// Empty or missing pieces are represented by null.
String[] result = new String[3];
for (int i = 0; i < pieces.length; ++i) {
String piece = pieces[i].trim();
if (!piece.isEmpty()) {
result[i] = piece;
}
}
// You MUST specify an algorithm.
if (result[0] == null) {
throw invalidTransformation(transformation);
}
if (!(result[1] == null && result[2] == null) && (result[1] == null || result[2] == null)) {
throw invalidTransformation(transformation);
}
return result;
}
代码示例来源:origin: ibinti/bugvm
private static String[] checkTransformation(String transformation) throws NoSuchAlgorithmException {
// ignore an extra prefix / characters such as in
// "/DES/CBC/PKCS5Paddin" http://b/3387688
if (transformation.startsWith("/")) {
transformation = transformation.substring(1);
}
// 'transformation' should be of the form "algorithm/mode/padding".
String[] pieces = transformation.split("/");
if (pieces.length > 3) {
throw invalidTransformation(transformation);
}
// Empty or missing pieces are represented by null.
String[] result = new String[3];
for (int i = 0; i < pieces.length; ++i) {
String piece = pieces[i].trim();
if (!piece.isEmpty()) {
result[i] = piece;
}
}
// You MUST specify an algorithm.
if (result[0] == null) {
throw invalidTransformation(transformation);
}
if (!(result[1] == null && result[2] == null) && (result[1] == null || result[2] == null)) {
throw invalidTransformation(transformation);
}
return result;
}
代码示例来源:origin: FlexoVM/flexovm
private static String[] checkTransformation(String transformation) throws NoSuchAlgorithmException {
// ignore an extra prefix / characters such as in
// "/DES/CBC/PKCS5Paddin" http://b/3387688
if (transformation.startsWith("/")) {
transformation = transformation.substring(1);
}
// 'transformation' should be of the form "algorithm/mode/padding".
String[] pieces = transformation.split("/");
if (pieces.length > 3) {
throw invalidTransformation(transformation);
}
// Empty or missing pieces are represented by null.
String[] result = new String[3];
for (int i = 0; i < pieces.length; ++i) {
String piece = pieces[i].trim();
if (!piece.isEmpty()) {
result[i] = piece;
}
}
// You MUST specify an algorithm.
if (result[0] == null) {
throw invalidTransformation(transformation);
}
if (!(result[1] == null && result[2] == null) && (result[1] == null || result[2] == null)) {
throw invalidTransformation(transformation);
}
return result;
}
代码示例来源:origin: com.gluonhq/robovm-rt
private static String[] checkTransformation(String transformation) throws NoSuchAlgorithmException {
// ignore an extra prefix / characters such as in
// "/DES/CBC/PKCS5Paddin" http://b/3387688
if (transformation.startsWith("/")) {
transformation = transformation.substring(1);
}
// 'transformation' should be of the form "algorithm/mode/padding".
String[] pieces = transformation.split("/");
if (pieces.length > 3) {
throw invalidTransformation(transformation);
}
// Empty or missing pieces are represented by null.
String[] result = new String[3];
for (int i = 0; i < pieces.length; ++i) {
String piece = pieces[i].trim();
if (!piece.isEmpty()) {
result[i] = piece;
}
}
// You MUST specify an algorithm.
if (result[0] == null) {
throw invalidTransformation(transformation);
}
if (!(result[1] == null && result[2] == null) && (result[1] == null || result[2] == null)) {
throw invalidTransformation(transformation);
}
return result;
}
代码示例来源:origin: MobiVM/robovm
private static String[] checkTransformation(String transformation) throws NoSuchAlgorithmException {
// ignore an extra prefix / characters such as in
// "/DES/CBC/PKCS5Paddin" http://b/3387688
if (transformation.startsWith("/")) {
transformation = transformation.substring(1);
}
// 'transformation' should be of the form "algorithm/mode/padding".
String[] pieces = transformation.split("/");
if (pieces.length > 3) {
throw invalidTransformation(transformation);
}
// Empty or missing pieces are represented by null.
String[] result = new String[3];
for (int i = 0; i < pieces.length; ++i) {
String piece = pieces[i].trim();
if (!piece.isEmpty()) {
result[i] = piece;
}
}
// You MUST specify an algorithm.
if (result[0] == null) {
throw invalidTransformation(transformation);
}
if (!(result[1] == null && result[2] == null) && (result[1] == null || result[2] == null)) {
throw invalidTransformation(transformation);
}
return result;
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
private static String[] checkTransformation(String transformation) throws NoSuchAlgorithmException {
// ignore an extra prefix / characters such as in
// "/DES/CBC/PKCS5Paddin" http://b/3387688
if (transformation.startsWith("/")) {
transformation = transformation.substring(1);
}
// 'transformation' should be of the form "algorithm/mode/padding".
String[] pieces = transformation.split("/");
if (pieces.length > 3) {
throw invalidTransformation(transformation);
}
// Empty or missing pieces are represented by null.
String[] result = new String[3];
for (int i = 0; i < pieces.length; ++i) {
String piece = pieces[i].trim();
if (!piece.isEmpty()) {
result[i] = piece;
}
}
// You MUST specify an algorithm.
if (result[0] == null) {
throw invalidTransformation(transformation);
}
if (!(result[1] == null && result[2] == null) && (result[1] == null || result[2] == null)) {
throw invalidTransformation(transformation);
}
return result;
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
throw invalidTransformation(transformation);
代码示例来源:origin: com.gluonhq/robovm-rt
throw invalidTransformation(transformation);
代码示例来源:origin: com.bugvm/bugvm-rt
throw invalidTransformation(transformation);
代码示例来源:origin: MobiVM/robovm
throw invalidTransformation(transformation);
代码示例来源:origin: ibinti/bugvm
throw invalidTransformation(transformation);
代码示例来源:origin: FlexoVM/flexovm
throw invalidTransformation(transformation);
内容来源于网络,如有侵权,请联系作者删除!