- java.lang.Object
-
- com.zerodeplibs.webpush.key.PEMParsers
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PEMParserofStandard(String label)Creates a newPEMParserwith the given type label.
-
-
-
Method Detail
-
ofStandard
public static PEMParser ofStandard(String label)
Creates a new
PEMParserwith the given type label.In order to extract the content between '-----BEGIN PRIVATE KEY-----' and '-----END PRIVATE KEY-----' for example, pass 'PRIVATE KEY' to the
labelargument.This parser ignores characters outside the encapsulation boundaries (i.e. all the characters before '-----BEGIN .... -----' or after '-----END ..... -----').
Examples:// Creates a parser for PEM-encoded texts // in which the private key data starts with '-----BEGIN PRIVATE KEY-----' // and ends with '-----END PRIVATE KEY-----'. PEMParser.ofStandard("PRIVATE KEY"); // Creates a parser for PEM-encoded texts // in which the public key data starts with '-----BEGIN PUBLIC KEY-----' // and ends with '-----END PUBLIC KEY-----'. PEMParser.ofStandard("PUBLIC KEY");The returned
PEMParseris intended to parse texts encoded in the 'Standard' format described in RFC7468.- Parameters:
label- a type label.- Returns:
- a new
PEMParser. - Throws:
IllegalArgumentException- if the format of the given label is invalid.
-
-