Libraries
PEM Source Code
 previous   up   next 

Types
pemObject
Type to describe the contents of a PEM cryptographic file.

pemObject

const type: pemObject

Type to describe the contents of a PEM cryptographic file.


Function Summary
pemObject
pemObject (in string: pemType, in string: content)
Create a PEM object from pemType and content.
string
str (in pemObject: pemObj)
Convert a PEM object to a string with PEM data.
pemObject
pemObject (in string: pemData)
Convert a string with PEM data to a PEM object.
pemObject
readPemObject (inout file: pemFile)
Read the next PEM object from the given pemFile.

Function Detail

pemObject

const func pemObject: pemObject (in string: pemType, in string: content)

Create a PEM object from pemType and content.

pemObject("CERTIFICATE", certificateBytes);
Parameters:
pemType - Tyoe of the PEM object.
content - String of bytes with the content of the PEM object.

str

const func string: str (in pemObject: pemObj)

Convert a PEM object to a string with PEM data. PEM data consists of a head, base64 encoded content and a footer. E.g.:

-----BEGIN aPemType-----
<base64 encoded data>
-----END aPemType-----
Parameters:
pemObj - PEM object with valid type and content.
Raises:
RANGE_ERROR - If PEM content contains characters beyond '\255;'.

pemObject

const func pemObject: pemObject (in string: pemData)

Convert a string with PEM data to a PEM object. PEM data consists of a head, base64 encoded content and a footer. E.g.:

-----BEGIN aPemType-----
<base64 encoded data>
-----END aPemType-----
Parameters:
pemData - String which contains PEM data.
Raises:
RANGE_ERROR - If string does not contain PEM data.

readPemObject

const func pemObject: readPemObject (inout file: pemFile)

Read the next PEM object from the given pemFile.

aPemObject := readPemObject(pemFile);
while aPemObject <> pemObject.value do
  ...
  aPemObject := readPemObject(pemFile);
end while;
Parameters:
pemFile - File that contains PEM objects.
Returns:
A PEM object with PEM type and content, or or a PEM object with empty type and content if the file in not in PEM format.
Raises:
RANGE_ERROR - If the PEM data is not in Base64 format.


 previous   up   next