aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography/x509/name.py
Commit message (Collapse)AuthorAgeFilesLines
* Use literals for collections and comprehensions. (#5091)Mads Jensen2020-01-121-1/+1
|
* 4810 bugfix: avoid UnicodeEncodeError on python 2 (#4846)redshiftzero2019-04-161-1/+4
| | | | | | | | * test: regression test for UnicodeEncodeError in x509 name in #4810 added utf8 encoding at the top of the file due to PEP 263 * bugfix: #4810 resolve UnicodeEncodeError in x509 name
* Simplify string formatting (#4757)Alex Gaynor2019-02-201-2/+2
|
* Remove spaces from RFC 4514 strings for better compliance (#4643) (#4646)Marti Raudsepp2018-12-181-1/+1
| | | | | | RFC 4514 does not explicitly allow whitespace between separators: https://tools.ietf.org/html/rfc4514 Reported-by: David Arnold <dar@xoe.solutions>
* Add RFC 4514 Distinguished Name formatting for Name, RDN and NameAttribute ↵Marti Raudsepp2018-12-081-2/+68
| | | | (#4304)
* Make RelativeDistinguishedName preserve attribtue order (#4306)Marti Raudsepp2018-07-091-3/+8
| | | | Duplicate attributes now raise an error instead of silently discarding duplicates.
* Fix ASN1 string type encoding for several Name OIDs (#4035)Paul Kehrer2017-11-301-7/+15
| | | | | | | | | | | | | | | | | | | * Fix ASN1 string type encoding for several Name OIDs When we changed over to the new type encoding system we didn't verify that the new code exactly matched the ASN1 string types that OpenSSL was previously choosing. This caused serialNumber, dnQualifier, emailAddress, and domainComponent to change from their proper encodings to UTF8String as of version 2.1. Now we check to see if there's a sentinel value (indicating no custom type has been passed) and then check if the OID has a different default than UTF8. If it does, we set it. This PR also adds tests for the ASN1 string type of ever supported NameOID. * review feedback
* both parse and encode the ASN1 string type for Name attributes (#3896)Paul Kehrer2017-09-251-5/+41
| | | | | | | | | | | | | | | * both parse and encode the ASN1 string type for Name attributes Previously cryptography encoded everything (except country names) as UTF8String. This caused problems with chain building in libraries like NSS where the subject and issuer are expected to match byte-for-byte. With this change we now parse and store the ASN1 string type as a private _type in NameAttribute. We then use this to encode when issuing a new certificate. This allows the CertificateBuilder to properly construct an identical issuer and fixes the issue with NSS. * make the sentinel private too
* disallow empty string for NameAttribute (#3711)Paul Kehrer2017-06-191-0/+3
|
* Add a bytes method to get the DER ASN.1 encoding of an X509 name. (#3236)Paul Kehrer2016-11-131-0/+3
| | | | | | | | | | * Add a bytes method to get the DER ASN.1 encoding of an X509 name. This is useful for creating an OpenSSL style subject_name_hash (#3011) * add to backend interface and update multibackend * bytes -> public_bytes
* Name: add support for multi-value RDNs (#3202)Fraser Tweedale2016-11-111-7/+20
| | | | | | | | Update the Name class to accept and internally store a list of RelativeDistinguishedName objects. Add the 'rdns' attribute to give access to the RDNs. Update ASN.1 routines to correctly decode and encode multi-value RDNs. Fixes: https://github.com/pyca/cryptography/issues/3199
* Make DistributionPoint relative_name a set of NameAttribute (#3210)Fraser Tweedale2016-11-071-0/+35
| | | | | | | | | | | * Add RelativeDistinguishedName class * Make relative_name a RelativeDistinguishedName DistributionPoint relative_name is currently a Name but RFC 5280 defines it as RelativeDistinguishedName, i.e. a non-empty SET OF name attributes. Change the DistributionPoint relative_name attribute to be a RelativeDistinguishedName.
* Allow passing iterators where collections are expected (#3078)Marti2016-08-261-0/+4
| | | | | | | | | | | | | | Iterators can only be enumerated once, breaking code like this in Python 3 for example: san = SubjectAlternativeName(map(DNSName, lst)) This is also a slight behavior change if the caller modifies the list after passing it to the constructor, because input lists are now copied. Which seems like a good thing. Also: * Name now checks that attributes elements are of type NameAttribute * NoticeReference now allows notice_numbers to be any iterable
* test passed because UnicodeEncodeError is a subclass of ValueErrorPaul Kehrer2016-03-061-1/+1
| | | | That's obviously not right. Hooray subclasses.
* raise ValueError if > 2 byte value for NameAttribute with CN OIDPaul Kehrer2016-03-061-1/+6
|
* Fixed #2444 -- added an __hash__ to x509 NamesAlex Gaynor2015-10-241-0/+8
|
* split Name from x509 modulePaul Kehrer2015-08-091-0/+70