// ----------------------------------------------------------------------------- // TSTSCharacterSetConverter::IsPrintable // checks if the given character is allowed in PrintableString // ----------------------------------------------------------------------------- // TBool TSTSCharacterSetConverter::IsPrintable( const TChar& aValue) const { if (aValue > 128) // non-ascii characters are not allowed { return EFalse; } if (aValue.IsAlphaDigit()) // A-Z,a-z,0-9 are allowed { return ETrue; } switch (aValue) // some other characters are also allowed { case(' '): case('\''): case('('): case(')'): case('+'): case(','): case('-'): case('.'): case('/'): case(':'): case('='): case('?'): { return ETrue; } default: { return EFalse; } } }
// ----------------------------------------------------------------------------- // CSTSCredentialManager::CheckOIDL // Checks if given OID is formatted correctly // ----------------------------------------------------------------------------- void CSTSCredentialManager::CheckOIDL(const TDesC& aOID) { TInt oidLength = aOID.Length(); if (oidLength == 0) { // empty oid is illegal User::Leave(KErrArgument); } for (TInt i = 0; i < oidLength; i++) { TChar oidChar = aOID[ i ]; if (!oidChar.IsAlphaDigit()) { if ((oidChar != KSTSDot) && (oidChar != KSTSLine)) { User::Leave(KErrArgument); } } } }