cryptoservices/certificateandkeymgmt/x500/x520ava.cpp
changeset 33 cf642210ecb7
parent 29 ece3df019add
equal deleted inserted replaced
29:ece3df019add 33:cf642210ecb7
   229 			TASN1DecGeneric decoderGeneric(aValue);
   229 			TASN1DecGeneric decoderGeneric(aValue);
   230 			decoderGeneric.InitL();
   230 			decoderGeneric.InitL();
   231 			type = decoderGeneric.Tag();	
   231 			type = decoderGeneric.Tag();	
   232 			break;	
   232 			break;	
   233 			}
   233 			}
       
   234 		case EX520Description:
       
   235 			{
       
   236 			ptr.Set(KX520Description);
       
   237 			maxlen = KX520MaxDescriptionLength;
       
   238 			break;
       
   239 			}
   234 		default:
   240 		default:
   235 			User::Leave(KErrArgument);
   241 			User::Leave(KErrArgument);
   236 		}
   242 		}
   237 	// Verify if the passed length is within limits
   243 	// Verify if the passed length is within limits
   238 	if(aValue.Length() > maxlen)
   244 	if(aValue.Length() > maxlen)
   395 		}
   401 		}
   396 	if (iType->Des() == KRFC2256Street)
   402 	if (iType->Des() == KRFC2256Street)
   397 		{
   403 		{
   398 		maxLength = KRFC2256StreetLength;
   404 		maxLength = KRFC2256StreetLength;
   399 		}
   405 		}
       
   406 	if (iType->Des() == KX520Description)
       
   407 		{
       
   408 		maxLength = KX520MaxDescriptionLength;
       
   409 		}
   400 	if (maxLength == 0)
   410 	if (maxLength == 0)
   401 		{
   411 		{
   402 		User::Leave(KErrNotSupported);
   412 		User::Leave(KErrNotSupported);
   403 		}
   413 		}
   404 	TASN1DecX500DirectoryString encDString;
   414 	TASN1DecX500DirectoryString encDString;
   408 	}
   418 	}
   409 
   419 
   410 TBool CX520AttributeTypeAndValue::IsCaseInSensitiveL(const TDesC8& aSource) const
   420 TBool CX520AttributeTypeAndValue::IsCaseInSensitiveL(const TDesC8& aSource) const
   411 	{
   421 	{
   412 	TPtr attribute = iType->Des();
   422 	TPtr attribute = iType->Des();
   413 	TBool caseInsensitiveAttr = (attribute == KPKCS9EmailAddress || attribute == KPKCS9UnstructuredName);
   423 	TBool caseInsensitiveAttr = (attribute == KPKCS9EmailAddress || attribute == KPKCS9UnstructuredName || attribute == KX520Description);
   414 	TASN1DecGeneric gen(aSource);
   424 	TASN1DecGeneric gen(aSource);
   415 	gen.InitL();
   425 	gen.InitL();
   416 	return ((gen.Tag() == EASN1PrintableString) || caseInsensitiveAttr);
   426 	return ((gen.Tag() == EASN1PrintableString) || caseInsensitiveAttr);
   417 	}
   427 	}
   418 
   428