Home | History | Annotate | Download | only in pem

Lines Matching defs:Block

19 // A Block represents a PEM encoded structure.
27 type Block struct {
74 // Decode will find the next PEM formatted block (certificate, private key
75 // etc) in the input. It returns that block and the remainder of the input. If
78 func Decode(data []byte) (p *Block, rest []byte) {
96 p = &Block{
167 // leading newline if the PEM block was empty.
173 func decodeError(data, rest []byte) (*Block, []byte) {
175 // ultimately invalid PEM block. We need to start over from a new
179 // the preamble line for the any subsequent block. Thus, we will always
180 // find any valid block, no matter what bytes precede it.
184 // -----BEGIN MALFORMED BLOCK-----
188 // -----BEGIN ACTUAL BLOCK-----
190 // -----END ACTUAL BLOCK-----
256 func Encode(out io.Writer, b *Block) error {
257 // Check for invalid block before writing any output.
326 func EncodeToMemory(b *Block) []byte {