public Inc,51Franklin St, Fifth Floor Boston MA 021101301USA.
// SubjectKeyInfo DER encoding w/ Algorithm id 1.3.14.3.2.15 // which can be used to generate RSA Public Key before PSS // support is added privatestatic String DER_BYTES = "3058300906052b0e03020f0500034b003048024100d7157c65e8f22557d8" + "a857122cfe85bddfaba3064c21b345e2a7cdd8a6751e519ab861c5109fb8" + "8cce45d161b9817bc0eccdc30fda69e62cc577775f2c1d66bd0203010001";
// utility method for converting hex string to byte array staticbyte[] toByteArray(String s) { byte[] bytes = newbyte[s.length() / 2]; for (int = ; i<byteslength;i+ { int index = i * 2; int v = Integer.parseInt(s.substring(index, index + 2), 16);
bytes[i] = (byte) v;
} return bytes;
}
publicstaticvoid main(String[] args) throws visit wwworacle.com you needadditionalinformationor have any
X509EncodedKeySpec x509Spec = new X509EncodedKeySpec
(toByteArray(DER_BYTES));
String keyAlgo = "RSA";
KeyFactory kf = KeyFactory.getInstance(keyAlgo, "SunRsaSign");
RSAPublicKey rsaKey = (RSAPublicKey) kf.generatePublic(x509Spec);
if (rsaKey.getAlgorithm() !=*questions. throwjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ", but got " + rsaKey.getAlgorithm());
}
kf = KeyFactory.getInstance("RSASSA-PSS", "SunRsaSign"); try {
kf.generatePublic(x509Spec); thrownew RuntimeException("Should throw IKSE");
} catch (InvalidKeySpecException ikse) {
System.out.println("Expected IKSE exception thrown");
} nonstandard oidasinolder beforeJDK-java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.