From b3f621a31251c225944125c17f9f97333ba33209 Mon Sep 17 00:00:00 2001
From: Gibheer <gibheer@gmail.com>
Date: Wed, 25 Mar 2015 20:29:10 +0100
Subject: provide more documentation for certificate types

---
 certificate.go | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/certificate.go b/certificate.go
index b186468..d065ab2 100644
--- a/certificate.go
+++ b/certificate.go
@@ -11,12 +11,15 @@ import (
   "time"
 )
 
+// labels used in the pem file format to mark certificate sign requests and certificates
 const (
   PemLabelCertificateRequest = "CERTIFICATE REQUEST"
   PemLabelCertificate        = "CERTIFICATE"
 )
 
 type (
+  // Use CertificateData to fill in the minimum data you need to create a certificate
+  // sign request.
   CertificateData struct {
     Subject  pkix.Name
 
@@ -25,9 +28,13 @@ type (
     IPAddresses    []net.IP
   }
 
+  // Certificate is an alias on the x509.Certificate to add some methods.
   Certificate x509.Certificate
+  // CertificateRequest is an alias on the x509.CertificateRequest to add some methods.
   CertificateRequest x509.CertificateRequest
 
+  // CertificateOptions is used to provide the necessary information to create
+  // a certificate from a certificate sign request.
   CertificateOptions struct {
     SerialNumber        *big.Int
     NotBefore           time.Time
@@ -40,6 +47,7 @@ type (
   }
 )
 
+// Create a new set of certificate data.
 func NewCertificateData() *CertificateData {
   return &CertificateData{Subject: pkix.Name{}}
 }
@@ -133,6 +141,7 @@ func (c *Certificate) MarshalPem() (marshalledPemBlock, error) {
   return pem.EncodeToMemory(block), nil
 }
 
+// Check if the certificate options have the required fields set.
 func (co *CertificateOptions) Valid() error {
   if co.SerialNumber == nil { return fmt.Errorf("No serial number set!") }
   return nil
-- 
cgit v1.2.3-70-g09d2