Documentation ¶
Index ¶
Constants ¶
View Source
const ( PrefixInfo string = "/CA/INFO" PrefixNew = "/CA/NEW" PrefixChallenge = "/CA/CHALLENGE" )
View Source
const ( ApplicationStatusCodeBeforeChallenge ApplicationStatusCode = 0 ApplicationStatusCodeChallenge = 1 ApplicationStatusCodePending = 2 ApplicationStatusCodeSuccess = 3 ApplicationStatusCodeFailure = 4 )
View Source
const ( ChallengeStatusCodeNeedCode string = "need-code" ChallengeStatusCodeInvalidEmail = "invalid-email" ChallengeStatusWrongCode = "wrong-code" ChallengeStatusCodeSuccess = "success" )
View Source
const ( ParameterKeyEmail string = "email" ParameterKeyCode = "code" )
View Source
const ( ErrorCodeBadInterestFormat ErrorCode = 1 ErrorCodeBadParameter = 2 ErrorCodeBadSignature = 3 ErrorCodeInvalidParameters = 4 ErrorCodeNameNotAllowed = 5 ErrorCodeBadValidityPeriod = 6 ErrorCodeRunOutOfTries = 7 ErrorCodeRunOutOfTime = 8 )
View Source
const ( ErrorReasonBadInterestFormat string = "Bad Interest Format: the Interest format is incorrect, e.g., no ApplicationParameters." ErrorReasonBadParameterFormat = "Bad Parameter Format: the ApplicationParameters field is not correctly formed." ErrorReasonBadSignature = "Bad Signature or signature info: the Interest carries an invalid signature." ErrorReasonInvalidParameters = "Invalid parameters: the input from the requester is not expected." ErrorReasonNameNotAllowed = "Name not allowed: the requested certificate name cannot be assigned to the requester." ErrorReasonBadValidityPeriod = "Bad ValidityPeriod: requested certificate has an erroneous validity period, e.g., too long time." ErrorReasonRunOutOfTries = "Run out of tries: the requester failed to complete the challenge within allowed number of attempts." ErrorReasonRunOutOfTime = "Run out of time: the requester failed to complete the challenge within time limit." )
View Source
const RequestIdLength = 8
View Source
const SchemaJson = `` /* 740-byte string literal not displayed */
View Source
const (
SecretCodeLength int = 6
)
View Source
const (
SelectedChallengeEmail string = "email"
)
Variables ¶
View Source
var AvailableChallenges = []string{SelectedChallengeEmail}
View Source
var ErrorCodeMapping = map[ErrorCode]string{ ErrorCodeBadInterestFormat: ErrorReasonBadInterestFormat, ErrorCodeBadParameter: ErrorReasonBadParameterFormat, ErrorCodeBadSignature: ErrorReasonBadSignature, ErrorCodeInvalidParameters: ErrorReasonInvalidParameters, ErrorCodeNameNotAllowed: ErrorReasonNameNotAllowed, ErrorCodeBadValidityPeriod: ErrorReasonBadValidityPeriod, ErrorCodeRunOutOfTries: ErrorReasonRunOutOfTries, ErrorCodeRunOutOfTime: ErrorReasonRunOutOfTime, }
Functions ¶
This section is empty.
Types ¶
type ApplicationStatusCode ¶
type ApplicationStatusCode uint64
type CaState ¶
type CaState struct { CaCertName string CaCertBytes []byte // In the case of a non-root CA, the signed certificate served must be passed in. CaInfo string CaPrefix string ChallengeRequestStateMapping map[RequestId]*ChallengeRequestState IdentityKey *ecdsa.PrivateKey MaxValidityPeriod time.Duration NotAfter time.Time NotBefore time.Time SmtpModule *email.SmtpModule Signer ndn.Signer }
func NewCaState ¶
func (*CaState) OnChallenge ¶
type ChallengeRequestState ¶
type ChallengeRequestState struct {
// contains filtered or unexported fields
}
type ChallengeState ¶
func NewChallengeState ¶
func NewChallengeState() *ChallengeState
type ChallengeStatus ¶
type ChallengeStatus uint64
const ( ChallengeStatusNewInterestReceived ChallengeStatus = iota ChallengeStatusChallengeIssued )
type ChallengeType ¶
type ChallengeType uint64
const ( TbdChallengeType ChallengeType = iota EmailChallengeType // Unused because we only have a single challenge type available )
type EmailChallengeState ¶
func NewEmailChallenge ¶
func NewEmailChallenge(smtpModule *email.SmtpModule, emailAddress string) (*EmailChallengeState, email.Status)
type ErrorReason ¶
type ErrorReason []byte
type RequestId ¶
type RequestId [RequestIdLength]byte
Click to show internal directories.
Click to hide internal directories.