cryptography-serialization-pem
PEM: encoding/decoding of PEM content from/to String or ByteArray
The module is currently experimental and is subject to API/ABI changes
Example
val encodedPemContent: String = PEM.encode(
PemContent(
label = PemLabel("KEY"),
bytes = "Hello World".encodeToByteArray()
)
)
println(encodedPemContent)
val decodedPemContent: PemContent = PEM.decode(
"""
-----BEGIN UNKNOWN-----
SGVsbG8gV29ybGQ=
-----END UNKNOWN-----
""".trimIndent(),
)
println(decodedPemContent.bytes.decodeToString()) // prints "Hello World"
Content copied to clipboard
Using in your projects
dependencies {
implementation("dev.whyoleg.cryptography:cryptography-serialization-pem:0.4.0")
}
Content copied to clipboard