Is there some high level way to write an X509Certificate into a PEM formatted string? Currently I'm doing x509cert.encode() to write it into a DER formatted string, then base 64 encoding it and appending the header and footer to create a PEM string, but it seems bad. Especially since I have to throw in line breaks too.
相关问题
- 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
In BouncyCastle 1.60
PEMWriter
has been deprecated in favour ofPemWriter
.PemWriter
is buffered so you do need to flush/close it before accessing the writer that it was constructed with.If you have PEMWriter from bouncy castle, then you can do the following :
Imports :
Code :