cryptoservices/certificateandkeymgmt/x500/x520ava.cpp
changeset 29 ece3df019add
parent 8 35751d3474b7
child 33 cf642210ecb7
equal deleted inserted replaced
19:cd501b96611d 29:ece3df019add
    19 #include <x520ava.h>
    19 #include <x520ava.h>
    20 #include "X500dec.h"
    20 #include "X500dec.h"
    21 #include <asn1enc.h>
    21 #include <asn1enc.h>
    22 #include <asn1dec.h>
    22 #include <asn1dec.h>
    23 
    23 
    24 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    25 //these are the only attribute types we handle at present
       
    26 _LIT(KX520PostalCode,"2.5.4.17");
       
    27 _LIT(KRFC2247DomainComponent, "0.9.2342.19200300.100.1.25");
       
    28 _LIT(KRFC2256Street,"2.5.4.9");
       
    29 _LIT(KPKCS9UnstructuredName, "1.2.840.113549.1.9.2");
       
    30 
       
    31 //email address is deprecated but we support it anyway...
       
    32 _LIT(KPKCS9EmailAddress, "1.2.840.113549.1.9.1");
       
    33 
       
    34 /** The maximum length allowed for a country name. */
       
    35 const TInt KX520MaxCLength = 2;
       
    36 /** The maximum length allowed for an organization name. */
       
    37 const TInt KX520MaxOLength = 64;
       
    38 /** The maximum length allowed for an organizational unit name. */
       
    39 const TInt KX520MaxOULength = 64;
       
    40 /** The maximum length allowed for a locality name. */
       
    41 const TInt KX520MaxLLength = 128;
       
    42 /** The maximum length allowed for a state or province name. */
       
    43 const TInt KX520MaxSOPLength = 128;
       
    44 /** The maximum length allowed for an title. */
       
    45 const TInt KX520MaxTLength = 64;
       
    46 /** The maximum length allowed for a common name. */
       
    47 const TInt KX520MaxCNLength = 256;
       
    48 /** The maximum length allowed for a given name. */
       
    49 const TInt KX520MaxGNLength = 16;
       
    50 /** The maximum length allowed for a surname. */
       
    51 const TInt KX520MaxSLength = 40;
       
    52 /** The maximum length allowed for initials. */
       
    53 const TInt KX520MaxILength = 5;
       
    54 /** The maximum length allowed for a generation qualifier. */
       
    55 const TInt KX520MaxGQLength = 3;
       
    56 /** The maximum length allowed for a serial number. */
       
    57 const TInt KX520MaxSNLength = 64;
       
    58 /** The maximum length allowed for a postal code. */
       
    59 const TInt KX520MaxPostalCodeLength = 40;
       
    60 /** The maximum length allowed for an email address. */
       
    61 const TInt KPKCS9MaxEmailAddressLength = 256;
       
    62 /** The maximum length allowed for an unstructured name. */
       
    63 const TInt KPKCS9MaxUnstructuredNameLength = 256;
       
    64 // No maximum was specified in the standard - 128 should be sufficient
       
    65 /** The maximum length allowed for an RFC 2247 domain component. 
       
    66 * 
       
    67 * Each component of the domain name is a short string. */
       
    68 const TInt KRFC2247MaxDomainComponentLength = 128;
       
    69 /** The maximum length allowed a for street. */
       
    70 const TInt KRFC2256StreetLength = 128;
       
    71 
       
    72 #endif
       
    73 
    24 
    74 EXPORT_C CX520AttributeTypeAndValue* CX520AttributeTypeAndValue::NewL(const CX520AttributeTypeAndValue& aPair)
    25 EXPORT_C CX520AttributeTypeAndValue* CX520AttributeTypeAndValue::NewL(const CX520AttributeTypeAndValue& aPair)
    75 	{
    26 	{
    76 	CX520AttributeTypeAndValue* self = CX520AttributeTypeAndValue::NewLC(aPair);
    27 	CX520AttributeTypeAndValue* self = CX520AttributeTypeAndValue::NewLC(aPair);
    77 	CleanupStack::Pop();//self
    28 	CleanupStack::Pop();//self