I have PEM format file, How can verify the signature in Java, as I followed http://download.oracle.com/javase/tutorial/security/apisign/versig.html but found that Java doesnt support PEM
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
You can read a certificate in a PEM file using BouncyCastle's
PEMReader
. If the content is an X.509 certificate, you should get an instance ofX509Certificate
and verify it as you want from there.EDIT: Here is what the code should look like (not tried):
(Of course, as with any I/O operations, you'll need to close the reader perhaps with try/finally.)
Note that
checkValidity
andverify
don't return anything: instead, they throw exceptions if when they fail.