Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for parseRFC2821Mailbox (0.26 sec)

  1. src/crypto/x509/verify.go

    type rfc2821Mailbox struct {
    	local, domain string
    }
    
    // parseRFC2821Mailbox parses an email address into local and domain parts,
    // based on the ABNF for a “Mailbox” from RFC 2821. According to RFC 5280,
    // Section 4.2.1.6 that's correct for an rfc822Name from a certificate: “The
    // format of an rfc822Name is a "Mailbox" as defined in RFC 2821, Section 4.1.2”.
    func parseRFC2821Mailbox(in string) (mailbox rfc2821Mailbox, ok bool) {
    	if len(in) == 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 22:58:39 UTC 2024
    - 35.7K bytes
    - Viewed (0)
  2. src/crypto/x509/parser.go

    				}
    
    				// If the constraint contains an @ then
    				// it specifies an exact mailbox name.
    				if strings.Contains(constraint, "@") {
    					if _, ok := parseRFC2821Mailbox(constraint); !ok {
    						return nil, nil, nil, nil, fmt.Errorf("x509: failed to parse rfc822Name constraint %q", constraint)
    					}
    				} else {
    					// Otherwise it's a domain name.
    					domain := constraint
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:00:16 UTC 2024
    - 38.5K bytes
    - Viewed (0)
  3. src/crypto/x509/name_constraints_test.go

    	{"******@****.***", "_somename", "example.com"},
    }
    
    func TestRFC2821Parsing(t *testing.T) {
    	for i, test := range rfc2821Tests {
    		mailbox, ok := parseRFC2821Mailbox(test.in)
    		expectedFailure := len(test.localPart) == 0 && len(test.domain) == 0
    
    		if ok && expectedFailure {
    			t.Errorf("#%d: %q unexpectedly parsed as (%q, %q)", i, test.in, mailbox.local, mailbox.domain)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 09 22:40:21 UTC 2024
    - 45.2K bytes
    - Viewed (0)
Back to top