Class PemData<KeySpecT>
java.lang.Object
dev.getelements.elements.sdk.model.security.PemData<KeySpecT>
- Type Parameters:
KeySpecT-
Represents a section of PEM (Privacy Enhanced Mail) data which may include a section of a key.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPemData(Rfc7468Label label, KeySpecT spec) Creates an instance ofPemDatawith the supplied label and specification.PemData(BufferedReader reader, Function<byte[], KeySpecT> keySpecFunction) PemData(InputStream inputStream, Function<byte[], KeySpecT> keySpecFunction) Creates an instance ofPemDatawith the supplied label and specification. -
Method Summary
Modifier and TypeMethodDescriptionFinds theRfc7468Labelassociated with this PemDecoder.getLabel()Gets the label from the PEM.getSpec()Gets the spec generated from the key.<OtherKeySpecT>
PemData<OtherKeySpecT> Maps thisPemDatato another type.toString()Returns a human-readable version of thisPemData, redacting the key information.
-
Field Details
-
MAX_LINE_LENGTH
public static final int MAX_LINE_LENGTH- See Also:
-
-
Constructor Details
-
PemData
public PemData(String pemString, Function<byte[], KeySpecT> keySpecFunction) throws InvalidPemException- Throws:
InvalidPemException
-
PemData
public PemData(InputStream inputStream, Function<byte[], KeySpecT> keySpecFunction) throws InvalidPemException- Throws:
InvalidPemException
-
PemData
- Throws:
InvalidPemException
-
PemData
public PemData(BufferedReader reader, Function<byte[], KeySpecT> keySpecFunction) throws InvalidPemException- Throws:
InvalidPemException
-
PemData
Creates an instance ofPemDatawith the supplied label and specification.- Parameters:
label- the labelspec- the specification
-
PemData
Creates an instance ofPemDatawith the supplied label and specification.- Parameters:
label- the labelspec- the specification
-
-
Method Details
-
getLabel
Gets the label from the PEM. Thsi should be- Returns:
- the label
-
findRfc7468Label
Finds theRfc7468Labelassociated with this PemDecoder.- Returns:
- a
Optionalcontaining the label
-
getSpec
Gets the spec generated from the key.- Returns:
- the spec
-
map
Maps thisPemDatato another type.- Type Parameters:
OtherKeySpecT- the other pem spec type- Parameters:
mapper- the mapper function- Returns:
- a new instance of the
PemDatawith the spec translated to the requested format
-
toString
Returns a human-readable version of thisPemData, redacting the key information.
-