%% Generated by the Erlang ASN.1 BER compiler. Version: 5.0.9 %% Purpose: Encoding and decoding of the types in SelectedAttributeTypes. -module('SelectedAttributeTypes'). -compile(nowarn_unused_vars). -dialyzer(no_improper_lists). -include("SelectedAttributeTypes.hrl"). -asn1_info([{vsn,'5.0.9'}, {module,'SelectedAttributeTypes'}, {options,[{i,"src"},noobj,{outdir,"src"},{i,"."},{i,"priv/kep"}]}]). -export([encoding_rule/0,maps/0,bit_string_format/0, legacy_erlang_types/0]). -export(['dialyzer-suppressions'/1]). -export([ enc_UniqueIdentifier/2, enc_CountryName/2, enc_Guide/2, enc_Criteria/2, enc_CriteriaItem/2, enc_EnhancedGuide/2, enc_PostalAddress/2, enc_TelephoneNumber/2, enc_TelexNumber/2, enc_FacsimileTelephoneNumber/2, enc_X121Address/2, enc_InternationalISDNNumber/2, enc_DestinationIndicator/2, enc_PreferredDeliveryMethod/2, enc_PresentationAddress/2, enc_ProtocolInformation/2, enc_NameAndOptionalUID/2, enc_MultipleMatchingLocalities/2, enc_SubstringAssertion/2, enc_CaseIgnoreListMatch/2, enc_OctetSubstringAssertion/2, enc_ZonalSelect/2, enc_ZonalResult/2, enc_LanguageContextSyntax/2, enc_TimeSpecification/2, enc_Period/2, enc_XDayOf/2, enc_NamedDay/2, enc_DayTimeBand/2, enc_DayTime/2, enc_TimeZone/2, enc_TimeAssertion/2, enc_LocaleContextSyntax/2, enc_G3FacsimileNonBasicParameters/2, enc_organizationName_DirectoryString/2, enc_givenName_DirectoryString/2, enc_description_DirectoryString/2, enc_organizationalUnitName_DirectoryString/2, enc_caseExactOrderingMatch_DirectoryString/2, enc_caseIgnoreOrderingMatch_DirectoryString/2, enc_destinationIndicator_DirectoryString/2, enc_localityName_DirectoryString/2, enc_commonName_DirectoryString/2, enc_streetAddress_DirectoryString/2, enc_pseudonym_DirectoryString/2, enc_generationQualifier_DirectoryString/2, enc_storedPrefixMatch_DirectoryString/2, enc_serialNumber_DirectoryString/2, enc_wordMatch_DirectoryString/2, enc_physicalDeliveryOfficeName_DirectoryString/2, enc_postalCode_DirectoryString/2, enc_businessCategory_DirectoryString/2, enc_dnQualifier_DirectoryString/2, enc_initials_DirectoryString/2, enc_postOfficeBox_DirectoryString/2, enc_title_DirectoryString/2, enc_caseExactMatch_DirectoryString/2, enc_caseIgnoreMatch_DirectoryString/2, enc_dmdName_DirectoryString/2, enc_surname_DirectoryString/2, enc_name_DirectoryString/2, enc_keywordMatch_DirectoryString/2, enc_stateOrProvinceName_DirectoryString/2, enc_knowledgeInformation_DirectoryString/2, enc_directoryStringFirstComponentMatch_DirectoryString/2, enc_houseIdentifier_DirectoryString/2 ]). -export([ dec_UniqueIdentifier/2, dec_CountryName/2, dec_Guide/2, dec_Criteria/2, dec_CriteriaItem/2, dec_EnhancedGuide/2, dec_PostalAddress/2, dec_TelephoneNumber/2, dec_TelexNumber/2, dec_FacsimileTelephoneNumber/2, dec_X121Address/2, dec_InternationalISDNNumber/2, dec_DestinationIndicator/2, dec_PreferredDeliveryMethod/2, dec_PresentationAddress/2, dec_ProtocolInformation/2, dec_NameAndOptionalUID/2, dec_MultipleMatchingLocalities/2, dec_SubstringAssertion/2, dec_CaseIgnoreListMatch/2, dec_OctetSubstringAssertion/2, dec_ZonalSelect/2, dec_ZonalResult/2, dec_LanguageContextSyntax/2, dec_TimeSpecification/2, dec_Period/2, dec_XDayOf/2, dec_NamedDay/2, dec_DayTimeBand/2, dec_DayTime/2, dec_TimeZone/2, dec_TimeAssertion/2, dec_LocaleContextSyntax/2, dec_G3FacsimileNonBasicParameters/2, dec_organizationName_DirectoryString/2, dec_givenName_DirectoryString/2, dec_description_DirectoryString/2, dec_organizationalUnitName_DirectoryString/2, dec_caseExactOrderingMatch_DirectoryString/2, dec_caseIgnoreOrderingMatch_DirectoryString/2, dec_destinationIndicator_DirectoryString/2, dec_localityName_DirectoryString/2, dec_commonName_DirectoryString/2, dec_streetAddress_DirectoryString/2, dec_pseudonym_DirectoryString/2, dec_generationQualifier_DirectoryString/2, dec_storedPrefixMatch_DirectoryString/2, dec_serialNumber_DirectoryString/2, dec_wordMatch_DirectoryString/2, dec_physicalDeliveryOfficeName_DirectoryString/2, dec_postalCode_DirectoryString/2, dec_businessCategory_DirectoryString/2, dec_dnQualifier_DirectoryString/2, dec_initials_DirectoryString/2, dec_postOfficeBox_DirectoryString/2, dec_title_DirectoryString/2, dec_caseExactMatch_DirectoryString/2, dec_caseIgnoreMatch_DirectoryString/2, dec_dmdName_DirectoryString/2, dec_surname_DirectoryString/2, dec_name_DirectoryString/2, dec_keywordMatch_DirectoryString/2, dec_stateOrProvinceName_DirectoryString/2, dec_knowledgeInformation_DirectoryString/2, dec_directoryStringFirstComponentMatch_DirectoryString/2, dec_houseIdentifier_DirectoryString/2 ]). -export([ enc_knowledgeInformation/3, enc_name/3, enc_commonName/3, enc_surname/3, enc_givenName/3, enc_initials/3, enc_generationQualifier/3, enc_uniqueIdentifier/3, enc_dnQualifier/3, enc_serialNumber/3, enc_pseudonym/3, enc_countryName/3, enc_localityName/3, enc_collectiveLocalityName/3, enc_stateOrProvinceName/3, enc_collectiveStateOrProvinceName/3, enc_streetAddress/3, enc_collectiveStreetAddress/3, enc_houseIdentifier/3, enc_organizationName/3, enc_collectiveOrganizationName/3, enc_organizationalUnitName/3, enc_collectiveOrganizationalUnitName/3, enc_title/3, enc_description/3, enc_searchGuide/3, enc_enhancedSearchGuide/3, enc_businessCategory/3, enc_postalAddress/3, enc_collectivePostalAddress/3, enc_postalCode/3, enc_collectivePostalCode/3, enc_postOfficeBox/3, enc_collectivePostOfficeBox/3, enc_physicalDeliveryOfficeName/3, enc_collectivePhysicalDeliveryOfficeName/3, enc_telephoneNumber/3, enc_collectiveTelephoneNumber/3, enc_telexNumber/3, enc_collectiveTelexNumber/3, enc_facsimileTelephoneNumber/3, enc_facsimileNumberMatch/3, enc_facsimileNumberSubstringsMatch/3, enc_collectiveFacsimileTelephoneNumber/3, enc_x121Address/3, enc_internationalISDNNumber/3, enc_collectiveInternationalISDNNumber/3, enc_registeredAddress/3, enc_destinationIndicator/3, enc_communicationsService/3, enc_communicationsNetwork/3, enc_preferredDeliveryMethod/3, enc_presentationAddress/3, enc_supportedApplicationContext/3, enc_protocolInformation/3, enc_distinguishedName/3, enc_member/3, enc_uniqueMember/3, enc_owner/3, enc_roleOccupant/3, enc_seeAlso/3, enc_dmdName/3, enc_dSAProblem/3, enc_searchServiceProblem/3, enc_serviceType/3, enc_attributeTypeList/3, enc_filterItem/3, enc_attributeCombinations/3, enc_contextTypeList/3, enc_contextList/3, enc_hierarchySelectList/3, enc_searchOptionsList/3, enc_serviceControlOptionsList/3, enc_multipleMatchingLocalities/3, enc_proposedRelaxation/3, enc_appliedRelaxation/3, enc_caseIgnoreMatch/3, enc_caseIgnoreOrderingMatch/3, enc_caseIgnoreSubstringsMatch/3, enc_caseExactMatch/3, enc_caseExactOrderingMatch/3, enc_caseExactSubstringsMatch/3, enc_numericStringMatch/3, enc_numericStringOrderingMatch/3, enc_numericStringSubstringsMatch/3, enc_caseIgnoreListMatch/3, enc_caseIgnoreListSubstringsMatch/3, enc_storedPrefixMatch/3, enc_booleanMatch/3, enc_integerMatch/3, enc_integerOrderingMatch/3, enc_bitStringMatch/3, enc_octetStringMatch/3, enc_octetStringOrderingMatch/3, enc_octetStringSubstringsMatch/3, enc_telephoneNumberMatch/3, enc_telephoneNumberSubstringsMatch/3, enc_presentationAddressMatch/3, enc_uniqueMemberMatch/3, enc_protocolInformationMatch/3, enc_uTCTimeMatch/3, enc_uTCTimeOrderingMatch/3, enc_generalizedTimeMatch/3, enc_generalizedTimeOrderingMatch/3, enc_integerFirstComponentMatch/3, enc_objectIdentifierFirstComponentMatch/3, enc_directoryStringFirstComponentMatch/3, enc_wordMatch/3, enc_keywordMatch/3, enc_systemProposedMatch/3, enc_generalWordMatch/3, enc_sequenceMatchType/3, enc_wordMatchTypes/3, enc_characterMatchTypes/3, enc_selectedContexts/3, enc_approximateStringMatch/3, enc_ignoreIfAbsentMatch/3, enc_nullMatch/3, enc_zonalMatch/3, enc_languageContext/3, enc_temporalContext/3, enc_localeContext/3 ]). -export([ dec_knowledgeInformation/3, dec_name/3, dec_commonName/3, dec_surname/3, dec_givenName/3, dec_initials/3, dec_generationQualifier/3, dec_uniqueIdentifier/3, dec_dnQualifier/3, dec_serialNumber/3, dec_pseudonym/3, dec_countryName/3, dec_localityName/3, dec_collectiveLocalityName/3, dec_stateOrProvinceName/3, dec_collectiveStateOrProvinceName/3, dec_streetAddress/3, dec_collectiveStreetAddress/3, dec_houseIdentifier/3, dec_organizationName/3, dec_collectiveOrganizationName/3, dec_organizationalUnitName/3, dec_collectiveOrganizationalUnitName/3, dec_title/3, dec_description/3, dec_searchGuide/3, dec_enhancedSearchGuide/3, dec_businessCategory/3, dec_postalAddress/3, dec_collectivePostalAddress/3, dec_postalCode/3, dec_collectivePostalCode/3, dec_postOfficeBox/3, dec_collectivePostOfficeBox/3, dec_physicalDeliveryOfficeName/3, dec_collectivePhysicalDeliveryOfficeName/3, dec_telephoneNumber/3, dec_collectiveTelephoneNumber/3, dec_telexNumber/3, dec_collectiveTelexNumber/3, dec_facsimileTelephoneNumber/3, dec_facsimileNumberMatch/3, dec_facsimileNumberSubstringsMatch/3, dec_collectiveFacsimileTelephoneNumber/3, dec_x121Address/3, dec_internationalISDNNumber/3, dec_collectiveInternationalISDNNumber/3, dec_registeredAddress/3, dec_destinationIndicator/3, dec_communicationsService/3, dec_communicationsNetwork/3, dec_preferredDeliveryMethod/3, dec_presentationAddress/3, dec_supportedApplicationContext/3, dec_protocolInformation/3, dec_distinguishedName/3, dec_member/3, dec_uniqueMember/3, dec_owner/3, dec_roleOccupant/3, dec_seeAlso/3, dec_dmdName/3, dec_dSAProblem/3, dec_searchServiceProblem/3, dec_serviceType/3, dec_attributeTypeList/3, dec_filterItem/3, dec_attributeCombinations/3, dec_contextTypeList/3, dec_contextList/3, dec_hierarchySelectList/3, dec_searchOptionsList/3, dec_serviceControlOptionsList/3, dec_multipleMatchingLocalities/3, dec_proposedRelaxation/3, dec_appliedRelaxation/3, dec_caseIgnoreMatch/3, dec_caseIgnoreOrderingMatch/3, dec_caseIgnoreSubstringsMatch/3, dec_caseExactMatch/3, dec_caseExactOrderingMatch/3, dec_caseExactSubstringsMatch/3, dec_numericStringMatch/3, dec_numericStringOrderingMatch/3, dec_numericStringSubstringsMatch/3, dec_caseIgnoreListMatch/3, dec_caseIgnoreListSubstringsMatch/3, dec_storedPrefixMatch/3, dec_booleanMatch/3, dec_integerMatch/3, dec_integerOrderingMatch/3, dec_bitStringMatch/3, dec_octetStringMatch/3, dec_octetStringOrderingMatch/3, dec_octetStringSubstringsMatch/3, dec_telephoneNumberMatch/3, dec_telephoneNumberSubstringsMatch/3, dec_presentationAddressMatch/3, dec_uniqueMemberMatch/3, dec_protocolInformationMatch/3, dec_uTCTimeMatch/3, dec_uTCTimeOrderingMatch/3, dec_generalizedTimeMatch/3, dec_generalizedTimeOrderingMatch/3, dec_integerFirstComponentMatch/3, dec_objectIdentifierFirstComponentMatch/3, dec_directoryStringFirstComponentMatch/3, dec_wordMatch/3, dec_keywordMatch/3, dec_systemProposedMatch/3, dec_generalWordMatch/3, dec_sequenceMatchType/3, dec_wordMatchTypes/3, dec_characterMatchTypes/3, dec_selectedContexts/3, dec_approximateStringMatch/3, dec_ignoreIfAbsentMatch/3, dec_nullMatch/3, dec_zonalMatch/3, dec_languageContext/3, dec_temporalContext/3, dec_localeContext/3 ]). -export([ 'id-at-encryptedAliasedEntryName'/0, 'id-at-knowledgeInformation'/0, 'id-at-commonName'/0, 'id-at-encryptedCommonName'/0, 'id-at-surname'/0, 'id-at-encryptedSurname'/0, 'id-at-serialNumber'/0, 'id-at-encryptedSerialNumber'/0, 'id-at-countryName'/0, 'id-at-encryptedCountryName'/0, 'id-at-localityName'/0, 'id-at-encryptedLocalityName'/0, 'id-at-collectiveLocalityName'/0, 'id-at-encryptedCollectiveLocalityName'/0, 'id-at-stateOrProvinceName'/0, 'id-at-encryptedStateOrProvinceName'/0, 'id-at-collectiveStateOrProvinceName'/0, 'id-at-encryptedCollectiveStateOrProvinceName'/0, 'id-at-streetAddress'/0, 'id-at-encryptedStreetAddress'/0, 'id-at-collectiveStreetAddress'/0, 'id-at-encryptedCollectiveStreetAddress'/0, 'id-at-organizationName'/0, 'id-at-encryptedOrganizationName'/0, 'id-at-collectiveOrganizationName'/0, 'id-at-encryptedCollectiveOrganizationName'/0, 'id-at-organizationalUnitName'/0, 'id-at-encryptedOrganizationalUnitName'/0, 'id-at-collectiveOrganizationalUnitName'/0, 'id-at-encryptedCollectiveOrganizationalUnitName'/0, 'id-at-title'/0, 'id-at-encryptedTitle'/0, 'id-at-description'/0, 'id-at-encryptedDescription'/0, 'id-at-searchGuide'/0, 'id-at-encryptedSearchGuide'/0, 'id-at-businessCategory'/0, 'id-at-encryptedBusinessCategory'/0, 'id-at-postalAddress'/0, 'id-at-encryptedPostalAddress'/0, 'id-at-collectivePostalAddress'/0, 'id-at-encryptedCollectivePostalAddress'/0, 'id-at-postalCode'/0, 'id-at-encryptedPostalCode'/0, 'id-at-collectivePostalCode'/0, 'id-at-encryptedCollectivePostalCode'/0, 'id-at-postOfficeBox'/0, 'id-at-encryptedPostOfficeBox'/0, 'id-at-collectivePostOfficeBox'/0, 'id-at-encryptedCollectivePostOfficeBox'/0, 'id-at-physicalDeliveryOfficeName'/0, 'id-at-encryptedPhysicalDeliveryOfficeName'/0, 'id-at-collectivePhysicalDeliveryOfficeName'/0, 'id-at-encryptedCollectivePhysicalDeliveryOfficeName'/0, 'id-at-telephoneNumber'/0, 'id-at-encryptedTelephoneNumber'/0, 'id-at-collectiveTelephoneNumber'/0, 'id-at-encryptedCollectiveTelephoneNumber'/0, 'id-at-telexNumber'/0, 'id-at-encryptedTelexNumber'/0, 'id-at-collectiveTelexNumber'/0, 'id-at-encryptedCollectiveTelexNumber'/0, 'id-at-facsimileTelephoneNumber'/0, 'id-at-encryptedFacsimileTelephoneNumber'/0, 'id-at-collectiveFacsimileTelephoneNumber'/0, 'id-at-encryptedCollectiveFacsimileTelephoneNumber'/0, 'id-at-x121Address'/0, 'id-at-encryptedX121Address'/0, 'id-at-internationalISDNNumber'/0, 'id-at-encryptedInternationalISDNNumber'/0, 'id-at-collectiveInternationalISDNNumber'/0, 'id-at-encryptedCollectiveInternationalISDNNumber'/0, 'id-at-registeredAddress'/0, 'id-at-encryptedRegisteredAddress'/0, 'id-at-destinationIndicator'/0, 'id-at-encryptedDestinationIndicator'/0, 'id-at-preferredDeliveryMethod'/0, 'id-at-encryptedPreferredDeliveryMethod'/0, 'id-at-presentationAddress'/0, 'id-at-encryptedPresentationAddress'/0, 'id-at-supportedApplicationContext'/0, 'id-at-encryptedSupportedApplicationContext'/0, 'id-at-member'/0, 'id-at-encryptedMember'/0, 'id-at-owner'/0, 'id-at-encryptedOwner'/0, 'id-at-roleOccupant'/0, 'id-at-encryptedRoleOccupant'/0, 'id-at-seeAlso'/0, 'id-at-encryptedSeeAlso'/0, 'id-at-encryptedUserPassword'/0, 'id-at-encryptedUserCertificate'/0, 'id-at-encryptedCACertificate'/0, 'id-at-encryptedAuthorityRevocationList'/0, 'id-at-encryptedCertificateRevocationList'/0, 'id-at-encryptedCrossCertificatePair'/0, 'id-at-name'/0, 'id-at-givenName'/0, 'id-at-encryptedGivenName'/0, 'id-at-initials'/0, 'id-at-encryptedInitials'/0, 'id-at-generationQualifier'/0, 'id-at-encryptedGenerationQualifier'/0, 'id-at-uniqueIdentifier'/0, 'id-at-encryptedUniqueIdentifier'/0, 'id-at-dnQualifier'/0, 'id-at-encryptedDnQualifier'/0, 'id-at-enhancedSearchGuide'/0, 'id-at-encryptedEnhancedSearchGuide'/0, 'id-at-protocolInformation'/0, 'id-at-encryptedProtocolInformation'/0, 'id-at-distinguishedName'/0, 'id-at-encryptedDistinguishedName'/0, 'id-at-uniqueMember'/0, 'id-at-encryptedUniqueMember'/0, 'id-at-houseIdentifier'/0, 'id-at-encryptedHouseIdentifier'/0, 'id-at-encryptedSupportedAlgorithms'/0, 'id-at-encryptedDeltaRevocationList'/0, 'id-at-dmdName'/0, 'id-at-encryptedDmdName'/0, 'id-at-encryptedClearance'/0, 'id-at-encryptedDefaultDirQop'/0, 'id-at-encryptedAttributeIntegrityInfo'/0, 'id-at-encryptedAttributeCertificate'/0, 'id-at-encryptedAttributeCertificateRevocationList'/0, 'id-at-encryptedConfKeyInfo'/0, 'id-at-pseudonym'/0, 'id-at-communicationsService'/0, 'id-at-communicationsNetwork'/0, 'id-mr-caseIgnoreMatch'/0, 'id-mr-caseIgnoreOrderingMatch'/0, 'id-mr-caseIgnoreSubstringsMatch'/0, 'id-mr-caseExactMatch'/0, 'id-mr-caseExactOrderingMatch'/0, 'id-mr-caseExactSubstringsMatch'/0, 'id-mr-numericStringMatch'/0, 'id-mr-numericStringOrderingMatch'/0, 'id-mr-numericStringSubstringsMatch'/0, 'id-mr-caseIgnoreListMatch'/0, 'id-mr-caseIgnoreListSubstringsMatch'/0, 'id-mr-booleanMatch'/0, 'id-mr-integerMatch'/0, 'id-mr-integerOrderingMatch'/0, 'id-mr-bitStringMatch'/0, 'id-mr-octetStringMatch'/0, 'id-mr-octetStringOrderingMatch'/0, 'id-mr-octetStringSubstringsMatch'/0, 'id-mr-telephoneNumberMatch'/0, 'id-mr-telephoneNumberSubstringsMatch'/0, 'id-mr-presentationAddressMatch'/0, 'id-mr-uniqueMemberMatch'/0, 'id-mr-protocolInformationMatch'/0, 'id-mr-uTCTimeMatch'/0, 'id-mr-uTCTimeOrderingMatch'/0, 'id-mr-generalizedTimeMatch'/0, 'id-mr-generalizedTimeOrderingMatch'/0, 'id-mr-integerFirstComponentMatch'/0, 'id-mr-objectIdentifierFirstComponentMatch'/0, 'id-mr-directoryStringFirstComponentMatch'/0, 'id-mr-wordMatch'/0, 'id-mr-keywordMatch'/0, 'id-mr-storedPrefixMatch'/0, 'id-mr-systemProposedMatch'/0, 'id-mr-generalWordMatch'/0, 'id-mr-approximateStringMatch'/0, 'id-mr-ignoreIfAbsentMatch'/0, 'id-mr-nullMatch'/0, 'id-mr-zonalMatch'/0, 'id-mr-facsimileNumberMatch'/0, 'id-mr-facsimileNumberSubstringsMatch'/0, 'id-avc-language'/0, 'id-avc-temporal'/0, 'id-avc-locale'/0, 'id-pr-targetDsaUnavailable'/0, 'id-pr-dataSourceUnavailable'/0, 'id-pr-unidentifiedOperation'/0, 'id-pr-unavailableOperation'/0, 'id-pr-searchAttributeViolation'/0, 'id-pr-searchAttributeCombinationViolation'/0, 'id-pr-searchValueNotAllowed'/0, 'id-pr-missingSearchAttribute'/0, 'id-pr-searchValueViolation'/0, 'id-pr-attributeNegationViolation'/0, 'id-pr-searchValueRequired'/0, 'id-pr-invalidSearchValue'/0, 'id-pr-searchContextViolation'/0, 'id-pr-searchContextCombinationViolation'/0, 'id-pr-missingSearchContext'/0, 'id-pr-searchContextValueViolation'/0, 'id-pr-searchContextValueRequired'/0, 'id-pr-invalidContextSearchValue'/0, 'id-pr-unsupportedMatchingRule'/0, 'id-pr-attributeMatchingViolation'/0, 'id-pr-unsupportedMatchingUse'/0, 'id-pr-matchingUseViolation'/0, 'id-pr-hierarchySelectForbidden'/0, 'id-pr-invalidHierarchySelect'/0, 'id-pr-unavailableHierarchySelect'/0, 'id-pr-invalidSearchOptions'/0, 'id-pr-missingSearchOptions'/0, 'id-pr-invalidServiceControlOptions'/0, 'id-pr-missingServiceControlOptions'/0, 'id-pr-searchSubsetViolation'/0, 'id-pr-unmatchedKeyAttributes'/0, 'id-pr-ambiguousKeyAttributes'/0, 'id-not-dSAProblem'/0, 'id-not-searchServiceProblem'/0, 'id-not-serviceType'/0, 'id-not-attributeTypeList'/0, 'id-not-matchingRuleList'/0, 'id-not-filterItem'/0, 'id-not-attributeCombinations'/0, 'id-not-contextTypeList'/0, 'id-not-contextList'/0, 'id-not-contextCombinations'/0, 'id-not-hierarchySelectList'/0, 'id-not-searchOptionsList'/0, 'id-not-serviceControlOptionsList'/0, 'id-not-multipleMatchingLocalities'/0, 'id-not-proposedRelaxation'/0, 'id-not-appliedRelaxation'/0, 'id-not-substringRequirements'/0, 'id-cat-sequenceMatchType'/0, 'id-cat-wordMatchType'/0, 'id-cat-characterMatchTypes'/0, 'id-cat-selectedContexts'/0 ]). -export([info/0]). -export([encode/2,decode/2]). encoding_rule() -> ber. maps() -> false. bit_string_format() -> bitstring. legacy_erlang_types() -> false. encode(Type, Data) -> try iolist_to_binary(element(1, encode_disp(Type, Data))) of Bytes -> {ok,Bytes} catch Class:Exception:Stk when Class =:= error; Class =:= exit -> case Exception of {error,{asn1,Reason}} -> {error,{asn1,{Reason,Stk}}}; Reason -> {error,{asn1,{Reason,Stk}}} end end. decode(Type, Data) -> try Result = decode_disp(Type, element(1, ber_decode_nif(Data))), {ok,Result} catch Class:Exception:Stk when Class =:= error; Class =:= exit -> case Exception of {error,{asn1,Reason}} -> {error,{asn1,{Reason,Stk}}}; Reason -> {error,{asn1,{Reason,Stk}}} end end. encode_disp('UniqueIdentifier', Data) -> enc_UniqueIdentifier(Data); encode_disp('CountryName', Data) -> enc_CountryName(Data); encode_disp('Guide', Data) -> enc_Guide(Data); encode_disp('Criteria', Data) -> enc_Criteria(Data); encode_disp('CriteriaItem', Data) -> enc_CriteriaItem(Data); encode_disp('EnhancedGuide', Data) -> enc_EnhancedGuide(Data); encode_disp('PostalAddress', Data) -> enc_PostalAddress(Data); encode_disp('TelephoneNumber', Data) -> enc_TelephoneNumber(Data); encode_disp('TelexNumber', Data) -> enc_TelexNumber(Data); encode_disp('FacsimileTelephoneNumber', Data) -> enc_FacsimileTelephoneNumber(Data); encode_disp('X121Address', Data) -> enc_X121Address(Data); encode_disp('InternationalISDNNumber', Data) -> enc_InternationalISDNNumber(Data); encode_disp('DestinationIndicator', Data) -> enc_DestinationIndicator(Data); encode_disp('PreferredDeliveryMethod', Data) -> enc_PreferredDeliveryMethod(Data); encode_disp('PresentationAddress', Data) -> enc_PresentationAddress(Data); encode_disp('ProtocolInformation', Data) -> enc_ProtocolInformation(Data); encode_disp('NameAndOptionalUID', Data) -> enc_NameAndOptionalUID(Data); encode_disp('MultipleMatchingLocalities', Data) -> enc_MultipleMatchingLocalities(Data); encode_disp('SubstringAssertion', Data) -> enc_SubstringAssertion(Data); encode_disp('CaseIgnoreListMatch', Data) -> enc_CaseIgnoreListMatch(Data); encode_disp('OctetSubstringAssertion', Data) -> enc_OctetSubstringAssertion(Data); encode_disp('ZonalSelect', Data) -> enc_ZonalSelect(Data); encode_disp('ZonalResult', Data) -> enc_ZonalResult(Data); encode_disp('LanguageContextSyntax', Data) -> enc_LanguageContextSyntax(Data); encode_disp('TimeSpecification', Data) -> enc_TimeSpecification(Data); encode_disp('Period', Data) -> enc_Period(Data); encode_disp('XDayOf', Data) -> enc_XDayOf(Data); encode_disp('NamedDay', Data) -> enc_NamedDay(Data); encode_disp('DayTimeBand', Data) -> enc_DayTimeBand(Data); encode_disp('DayTime', Data) -> enc_DayTime(Data); encode_disp('TimeZone', Data) -> enc_TimeZone(Data); encode_disp('TimeAssertion', Data) -> enc_TimeAssertion(Data); encode_disp('LocaleContextSyntax', Data) -> enc_LocaleContextSyntax(Data); encode_disp('G3FacsimileNonBasicParameters', Data) -> enc_G3FacsimileNonBasicParameters(Data); encode_disp(organizationName_DirectoryString, Data) -> enc_organizationName_DirectoryString(Data); encode_disp(givenName_DirectoryString, Data) -> enc_givenName_DirectoryString(Data); encode_disp(description_DirectoryString, Data) -> enc_description_DirectoryString(Data); encode_disp(organizationalUnitName_DirectoryString, Data) -> enc_organizationalUnitName_DirectoryString(Data); encode_disp(caseExactOrderingMatch_DirectoryString, Data) -> enc_caseExactOrderingMatch_DirectoryString(Data); encode_disp(caseIgnoreOrderingMatch_DirectoryString, Data) -> enc_caseIgnoreOrderingMatch_DirectoryString(Data); encode_disp(destinationIndicator_DirectoryString, Data) -> enc_destinationIndicator_DirectoryString(Data); encode_disp(localityName_DirectoryString, Data) -> enc_localityName_DirectoryString(Data); encode_disp(commonName_DirectoryString, Data) -> enc_commonName_DirectoryString(Data); encode_disp(streetAddress_DirectoryString, Data) -> enc_streetAddress_DirectoryString(Data); encode_disp(pseudonym_DirectoryString, Data) -> enc_pseudonym_DirectoryString(Data); encode_disp(generationQualifier_DirectoryString, Data) -> enc_generationQualifier_DirectoryString(Data); encode_disp(storedPrefixMatch_DirectoryString, Data) -> enc_storedPrefixMatch_DirectoryString(Data); encode_disp(serialNumber_DirectoryString, Data) -> enc_serialNumber_DirectoryString(Data); encode_disp(wordMatch_DirectoryString, Data) -> enc_wordMatch_DirectoryString(Data); encode_disp(physicalDeliveryOfficeName_DirectoryString, Data) -> enc_physicalDeliveryOfficeName_DirectoryString(Data); encode_disp(postalCode_DirectoryString, Data) -> enc_postalCode_DirectoryString(Data); encode_disp(businessCategory_DirectoryString, Data) -> enc_businessCategory_DirectoryString(Data); encode_disp(dnQualifier_DirectoryString, Data) -> enc_dnQualifier_DirectoryString(Data); encode_disp(initials_DirectoryString, Data) -> enc_initials_DirectoryString(Data); encode_disp(postOfficeBox_DirectoryString, Data) -> enc_postOfficeBox_DirectoryString(Data); encode_disp(title_DirectoryString, Data) -> enc_title_DirectoryString(Data); encode_disp(caseExactMatch_DirectoryString, Data) -> enc_caseExactMatch_DirectoryString(Data); encode_disp(caseIgnoreMatch_DirectoryString, Data) -> enc_caseIgnoreMatch_DirectoryString(Data); encode_disp(dmdName_DirectoryString, Data) -> enc_dmdName_DirectoryString(Data); encode_disp(surname_DirectoryString, Data) -> enc_surname_DirectoryString(Data); encode_disp(name_DirectoryString, Data) -> enc_name_DirectoryString(Data); encode_disp(keywordMatch_DirectoryString, Data) -> enc_keywordMatch_DirectoryString(Data); encode_disp(stateOrProvinceName_DirectoryString, Data) -> enc_stateOrProvinceName_DirectoryString(Data); encode_disp(knowledgeInformation_DirectoryString, Data) -> enc_knowledgeInformation_DirectoryString(Data); encode_disp(directoryStringFirstComponentMatch_DirectoryString, Data) -> enc_directoryStringFirstComponentMatch_DirectoryString(Data); encode_disp(houseIdentifier_DirectoryString, Data) -> enc_houseIdentifier_DirectoryString(Data); encode_disp(Type, _Data) -> exit({error,{asn1,{undefined_type,Type}}}). decode_disp('UniqueIdentifier', Data) -> dec_UniqueIdentifier(Data); decode_disp('CountryName', Data) -> dec_CountryName(Data); decode_disp('Guide', Data) -> dec_Guide(Data); decode_disp('Criteria', Data) -> dec_Criteria(Data); decode_disp('CriteriaItem', Data) -> dec_CriteriaItem(Data); decode_disp('EnhancedGuide', Data) -> dec_EnhancedGuide(Data); decode_disp('PostalAddress', Data) -> dec_PostalAddress(Data); decode_disp('TelephoneNumber', Data) -> dec_TelephoneNumber(Data); decode_disp('TelexNumber', Data) -> dec_TelexNumber(Data); decode_disp('FacsimileTelephoneNumber', Data) -> dec_FacsimileTelephoneNumber(Data); decode_disp('X121Address', Data) -> dec_X121Address(Data); decode_disp('InternationalISDNNumber', Data) -> dec_InternationalISDNNumber(Data); decode_disp('DestinationIndicator', Data) -> dec_DestinationIndicator(Data); decode_disp('PreferredDeliveryMethod', Data) -> dec_PreferredDeliveryMethod(Data); decode_disp('PresentationAddress', Data) -> dec_PresentationAddress(Data); decode_disp('ProtocolInformation', Data) -> dec_ProtocolInformation(Data); decode_disp('NameAndOptionalUID', Data) -> dec_NameAndOptionalUID(Data); decode_disp('MultipleMatchingLocalities', Data) -> dec_MultipleMatchingLocalities(Data); decode_disp('SubstringAssertion', Data) -> dec_SubstringAssertion(Data); decode_disp('CaseIgnoreListMatch', Data) -> dec_CaseIgnoreListMatch(Data); decode_disp('OctetSubstringAssertion', Data) -> dec_OctetSubstringAssertion(Data); decode_disp('ZonalSelect', Data) -> dec_ZonalSelect(Data); decode_disp('ZonalResult', Data) -> dec_ZonalResult(Data); decode_disp('LanguageContextSyntax', Data) -> dec_LanguageContextSyntax(Data); decode_disp('TimeSpecification', Data) -> dec_TimeSpecification(Data); decode_disp('Period', Data) -> dec_Period(Data); decode_disp('XDayOf', Data) -> dec_XDayOf(Data); decode_disp('NamedDay', Data) -> dec_NamedDay(Data); decode_disp('DayTimeBand', Data) -> dec_DayTimeBand(Data); decode_disp('DayTime', Data) -> dec_DayTime(Data); decode_disp('TimeZone', Data) -> dec_TimeZone(Data); decode_disp('TimeAssertion', Data) -> dec_TimeAssertion(Data); decode_disp('LocaleContextSyntax', Data) -> dec_LocaleContextSyntax(Data); decode_disp('G3FacsimileNonBasicParameters', Data) -> dec_G3FacsimileNonBasicParameters(Data); decode_disp(organizationName_DirectoryString, Data) -> dec_organizationName_DirectoryString(Data); decode_disp(givenName_DirectoryString, Data) -> dec_givenName_DirectoryString(Data); decode_disp(description_DirectoryString, Data) -> dec_description_DirectoryString(Data); decode_disp(organizationalUnitName_DirectoryString, Data) -> dec_organizationalUnitName_DirectoryString(Data); decode_disp(caseExactOrderingMatch_DirectoryString, Data) -> dec_caseExactOrderingMatch_DirectoryString(Data); decode_disp(caseIgnoreOrderingMatch_DirectoryString, Data) -> dec_caseIgnoreOrderingMatch_DirectoryString(Data); decode_disp(destinationIndicator_DirectoryString, Data) -> dec_destinationIndicator_DirectoryString(Data); decode_disp(localityName_DirectoryString, Data) -> dec_localityName_DirectoryString(Data); decode_disp(commonName_DirectoryString, Data) -> dec_commonName_DirectoryString(Data); decode_disp(streetAddress_DirectoryString, Data) -> dec_streetAddress_DirectoryString(Data); decode_disp(pseudonym_DirectoryString, Data) -> dec_pseudonym_DirectoryString(Data); decode_disp(generationQualifier_DirectoryString, Data) -> dec_generationQualifier_DirectoryString(Data); decode_disp(storedPrefixMatch_DirectoryString, Data) -> dec_storedPrefixMatch_DirectoryString(Data); decode_disp(serialNumber_DirectoryString, Data) -> dec_serialNumber_DirectoryString(Data); decode_disp(wordMatch_DirectoryString, Data) -> dec_wordMatch_DirectoryString(Data); decode_disp(physicalDeliveryOfficeName_DirectoryString, Data) -> dec_physicalDeliveryOfficeName_DirectoryString(Data); decode_disp(postalCode_DirectoryString, Data) -> dec_postalCode_DirectoryString(Data); decode_disp(businessCategory_DirectoryString, Data) -> dec_businessCategory_DirectoryString(Data); decode_disp(dnQualifier_DirectoryString, Data) -> dec_dnQualifier_DirectoryString(Data); decode_disp(initials_DirectoryString, Data) -> dec_initials_DirectoryString(Data); decode_disp(postOfficeBox_DirectoryString, Data) -> dec_postOfficeBox_DirectoryString(Data); decode_disp(title_DirectoryString, Data) -> dec_title_DirectoryString(Data); decode_disp(caseExactMatch_DirectoryString, Data) -> dec_caseExactMatch_DirectoryString(Data); decode_disp(caseIgnoreMatch_DirectoryString, Data) -> dec_caseIgnoreMatch_DirectoryString(Data); decode_disp(dmdName_DirectoryString, Data) -> dec_dmdName_DirectoryString(Data); decode_disp(surname_DirectoryString, Data) -> dec_surname_DirectoryString(Data); decode_disp(name_DirectoryString, Data) -> dec_name_DirectoryString(Data); decode_disp(keywordMatch_DirectoryString, Data) -> dec_keywordMatch_DirectoryString(Data); decode_disp(stateOrProvinceName_DirectoryString, Data) -> dec_stateOrProvinceName_DirectoryString(Data); decode_disp(knowledgeInformation_DirectoryString, Data) -> dec_knowledgeInformation_DirectoryString(Data); decode_disp(directoryStringFirstComponentMatch_DirectoryString, Data) -> dec_directoryStringFirstComponentMatch_DirectoryString(Data); decode_disp(houseIdentifier_DirectoryString, Data) -> dec_houseIdentifier_DirectoryString(Data); decode_disp(Type, _Data) -> exit({error,{asn1,{undefined_type,Type}}}). info() -> case ?MODULE:module_info(attributes) of Attributes when is_list(Attributes) -> case lists:keyfind(asn1_info, 1, Attributes) of {_,Info} when is_list(Info) -> Info; _ -> [] end; _ -> [] end. %%================================ %% UniqueIdentifier %%================================ enc_UniqueIdentifier(Val) -> enc_UniqueIdentifier(Val, [<<3>>]). enc_UniqueIdentifier(Val, TagIn) -> encode_unnamed_bit_string(Val, TagIn). dec_UniqueIdentifier(Tlv) -> dec_UniqueIdentifier(Tlv, [3]). dec_UniqueIdentifier(Tlv, TagIn) -> decode_native_bit_string(Tlv, TagIn). %%================================ %% CountryName %%================================ enc_CountryName(Val) -> enc_CountryName(Val, [<<19>>]). enc_CountryName(Val, TagIn) -> encode_restricted_string(Val, TagIn). dec_CountryName(Tlv) -> dec_CountryName(Tlv, [19]). dec_CountryName(Tlv, TagIn) -> begin Val1 = decode_restricted_string(Tlv, TagIn), C1 = byte_size(Val1), if C1 =:= 2 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end. %%================================ %% Guide %%================================ enc_Guide(Val) -> enc_Guide(Val, [<<49>>]). enc_Guide(Val, TagIn) -> {_,Cindex1,Cindex2} = Val, %%------------------------------------------------- %% attribute objectClass(1) with type OBJECT IDENTIFIER OPTIONAL %%------------------------------------------------- {EncBytes1,EncLen1} = case Cindex1 of asn1_NOVALUE -> {<<>>,0}; _ -> encode_object_identifier(Cindex1, [<<6>>,<<160>>]) end, %%------------------------------------------------- %% attribute criteria(2) External SelectedAttributeTypes:Criteria %%------------------------------------------------- {EncBytes2,EncLen2} = 'enc_Criteria'(Cindex2, [<<161>>]), BytesSoFar = [EncBytes1, EncBytes2], LenSoFar = EncLen1 + EncLen2, encode_tags(TagIn, BytesSoFar, LenSoFar). dec_Guide(Tlv) -> dec_Guide(Tlv, [17]). dec_Guide(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), SetFun = fun(FunTlv) -> case FunTlv of %objectClass TTlv = {131072,_} -> {1, TTlv}; %criteria TTlv = {131073,_} -> {2, TTlv}; Else -> {3, Else} end end, PositionList = [SetFun(TempTlv)|| TempTlv <- Tlv1], Tlv2 = [Stlv || {_,Stlv} <- lists:sort(PositionList)], %%------------------------------------------------- %% attribute objectClass(1) with type OBJECT IDENTIFIER OPTIONAL %%------------------------------------------------- {Term1,Tlv3} = case Tlv2 of [{131072,V1}|TempTlv3] -> {decode_object_identifier(V1, [6]), TempTlv3}; _ -> { asn1_NOVALUE, Tlv2} end, %%------------------------------------------------- %% attribute criteria(2) External SelectedAttributeTypes:Criteria %%------------------------------------------------- [V2|Tlv4] = Tlv3, Term2 = 'dec_Criteria'(V2, [131073]), case Tlv4 of [] -> true;_ -> exit({error,{asn1, {unexpected,Tlv4}}}) % extra fields not allowed end, Res1 = {'Guide',Term1,Term2}, Res1. %%================================ %% Criteria %%================================ enc_Criteria(Val) -> enc_Criteria(Val, []). enc_Criteria(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of type -> 'enc_CriteriaItem'(element(2,Val), [<<160>>]); 'and' -> 'enc_Criteria_and'(element(2,Val), [<<49>>,<<161>>]); 'or' -> 'enc_Criteria_or'(element(2,Val), [<<49>>,<<162>>]); 'not' -> 'enc_Criteria'(element(2,Val), [<<163>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). %%================================ %% Criteria_and %%================================ enc_Criteria_and(Val, TagIn) -> {EncBytes,EncLen} = 'enc_Criteria_and_components'(Val,[],0), encode_tags(TagIn, EncBytes, EncLen). 'enc_Criteria_and_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen}; 'enc_Criteria_and_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = 'enc_Criteria'(H, []), 'enc_Criteria_and_components'(T,[EncBytes|AccBytes], AccLen + EncLen). %%================================ %% Criteria_or %%================================ enc_Criteria_or(Val, TagIn) -> {EncBytes,EncLen} = 'enc_Criteria_or_components'(Val,[],0), encode_tags(TagIn, EncBytes, EncLen). 'enc_Criteria_or_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen}; 'enc_Criteria_or_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = 'enc_Criteria'(H, []), 'enc_Criteria_or_components'(T,[EncBytes|AccBytes], AccLen + EncLen). dec_Criteria(Tlv) -> dec_Criteria(Tlv, []). dec_Criteria(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'type' {131072, V1} -> {type, 'dec_CriteriaItem'(V1, [])}; %% 'and' {131073, V1} -> {'and', 'dec_Criteria_and'(V1, [17])}; %% 'or' {131074, V1} -> {'or', 'dec_Criteria_or'(V1, [17])}; %% 'not' {131075, V1} -> {'not', 'dec_Criteria'(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . 'dec_Criteria_and'(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), ['dec_Criteria'(V1, []) || V1 <- Tlv1]. 'dec_Criteria_or'(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), ['dec_Criteria'(V1, []) || V1 <- Tlv1]. %%================================ %% CriteriaItem %%================================ enc_CriteriaItem(Val) -> enc_CriteriaItem(Val, []). enc_CriteriaItem(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of equality -> encode_object_identifier(element(2,Val), [<<6>>,<<160>>]); substrings -> encode_object_identifier(element(2,Val), [<<6>>,<<161>>]); greaterOrEqual -> encode_object_identifier(element(2,Val), [<<6>>,<<162>>]); lessOrEqual -> encode_object_identifier(element(2,Val), [<<6>>,<<163>>]); approximateMatch -> encode_object_identifier(element(2,Val), [<<6>>,<<164>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_CriteriaItem(Tlv) -> dec_CriteriaItem(Tlv, []). dec_CriteriaItem(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'equality' {131072, V1} -> {equality, decode_object_identifier(V1, [6])}; %% 'substrings' {131073, V1} -> {substrings, decode_object_identifier(V1, [6])}; %% 'greaterOrEqual' {131074, V1} -> {greaterOrEqual, decode_object_identifier(V1, [6])}; %% 'lessOrEqual' {131075, V1} -> {lessOrEqual, decode_object_identifier(V1, [6])}; %% 'approximateMatch' {131076, V1} -> {approximateMatch, decode_object_identifier(V1, [6])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% EnhancedGuide %%================================ enc_EnhancedGuide(Val) -> enc_EnhancedGuide(Val, [<<48>>]). enc_EnhancedGuide(Val, TagIn) -> {_,Cindex1,Cindex2,Cindex3} = Val, %%------------------------------------------------- %% attribute objectClass(1) with type OBJECT IDENTIFIER %%------------------------------------------------- {EncBytes1,EncLen1} = encode_object_identifier(Cindex1, [<<6>>,<<160>>]), %%------------------------------------------------- %% attribute criteria(2) External SelectedAttributeTypes:Criteria %%------------------------------------------------- {EncBytes2,EncLen2} = 'enc_Criteria'(Cindex2, [<<161>>]), %%------------------------------------------------- %% attribute subset(3) with type INTEGER DEFAULT = 1 %%------------------------------------------------- {EncBytes3,EncLen3} = case Cindex3 of asn1_DEFAULT -> {<<>>,0}; _ when Cindex3 =:= 1 -> {<<>>,0}; _ -> encode_integer(Cindex3, [{baseObject,0},{oneLevel,1},{wholeSubtree,2}], [<<2>>,<<162>>]) end, BytesSoFar = [EncBytes1, EncBytes2, EncBytes3], LenSoFar = EncLen1 + EncLen2 + EncLen3, encode_tags(TagIn, BytesSoFar, LenSoFar). dec_EnhancedGuide(Tlv) -> dec_EnhancedGuide(Tlv, [16]). dec_EnhancedGuide(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), %%------------------------------------------------- %% attribute objectClass(1) with type OBJECT IDENTIFIER %%------------------------------------------------- [V1|Tlv2] = Tlv1, Term1 = decode_object_identifier(V1, [131072,6]), %%------------------------------------------------- %% attribute criteria(2) External SelectedAttributeTypes:Criteria %%------------------------------------------------- [V2|Tlv3] = Tlv2, Term2 = 'dec_Criteria'(V2, [131073]), %%------------------------------------------------- %% attribute subset(3) with type INTEGER DEFAULT = 1 %%------------------------------------------------- {Term3,Tlv4} = case Tlv3 of [{131074,V3}|TempTlv4] -> {begin Val1 = decode_integer(V3, [2]), number2name(Val1, [{baseObject,0},{oneLevel,1},{wholeSubtree,2}]) end , TempTlv4}; _ -> {1,Tlv3} end, case Tlv4 of [] -> true;_ -> exit({error,{asn1, {unexpected,Tlv4}}}) % extra fields not allowed end, Res1 = {'EnhancedGuide',Term1,Term2,Term3}, Res1. %%================================ %% PostalAddress %%================================ enc_PostalAddress(Val) -> enc_PostalAddress(Val, [<<48>>]). enc_PostalAddress(Val, TagIn) -> {EncBytes,EncLen} = 'enc_PostalAddress_components'(Val,[],0), encode_tags(TagIn, EncBytes, EncLen). 'enc_PostalAddress_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen}; 'enc_PostalAddress_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = 'enc_PostalAddress_SEQOF'(H, []), 'enc_PostalAddress_components'(T,[EncBytes|AccBytes], AccLen + EncLen). %%================================ %% PostalAddress_SEQOF %%================================ enc_PostalAddress_SEQOF(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_PostalAddress(Tlv) -> dec_PostalAddress(Tlv, [16]). dec_PostalAddress(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), ['dec_PostalAddress_SEQOF'(V1, []) || V1 <- Tlv1]. 'dec_PostalAddress_SEQOF'(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 30 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 30 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 30 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 30 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% TelephoneNumber %%================================ enc_TelephoneNumber(Val) -> enc_TelephoneNumber(Val, [<<19>>]). enc_TelephoneNumber(Val, TagIn) -> encode_restricted_string(Val, TagIn). dec_TelephoneNumber(Tlv) -> dec_TelephoneNumber(Tlv, [19]). dec_TelephoneNumber(Tlv, TagIn) -> begin Val1 = decode_restricted_string(Tlv, TagIn), C1 = byte_size(Val1), if 1 =< C1, C1 =< 32 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end. %%================================ %% TelexNumber %%================================ enc_TelexNumber(Val) -> enc_TelexNumber(Val, [<<48>>]). enc_TelexNumber(Val, TagIn) -> {_,Cindex1,Cindex2,Cindex3} = Val, %%------------------------------------------------- %% attribute telexNumber(1) with type PrintableString %%------------------------------------------------- {EncBytes1,EncLen1} = encode_restricted_string(Cindex1, [<<19>>]), %%------------------------------------------------- %% attribute countryCode(2) with type PrintableString %%------------------------------------------------- {EncBytes2,EncLen2} = encode_restricted_string(Cindex2, [<<19>>]), %%------------------------------------------------- %% attribute answerback(3) with type PrintableString %%------------------------------------------------- {EncBytes3,EncLen3} = encode_restricted_string(Cindex3, [<<19>>]), BytesSoFar = [EncBytes1, EncBytes2, EncBytes3], LenSoFar = EncLen1 + EncLen2 + EncLen3, encode_tags(TagIn, BytesSoFar, LenSoFar). dec_TelexNumber(Tlv) -> dec_TelexNumber(Tlv, [16]). dec_TelexNumber(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), %%------------------------------------------------- %% attribute telexNumber(1) with type PrintableString %%------------------------------------------------- [V1|Tlv2] = Tlv1, Term1 = begin Val1 = decode_restricted_string(V1, [19]), C1 = byte_size(Val1), if 1 =< C1, C1 =< 14 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end, %%------------------------------------------------- %% attribute countryCode(2) with type PrintableString %%------------------------------------------------- [V2|Tlv3] = Tlv2, Term2 = begin Val2 = decode_restricted_string(V2, [19]), C2 = byte_size(Val2), if 1 =< C2, C2 =< 4 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end, %%------------------------------------------------- %% attribute answerback(3) with type PrintableString %%------------------------------------------------- [V3|Tlv4] = Tlv3, Term3 = begin Val3 = decode_restricted_string(V3, [19]), C3 = byte_size(Val3), if 1 =< C3, C3 =< 8 -> binary_to_list(Val3); true -> exit({error,{asn1,bad_range}}) end end, case Tlv4 of [] -> true;_ -> exit({error,{asn1, {unexpected,Tlv4}}}) % extra fields not allowed end, Res1 = {'TelexNumber',Term1,Term2,Term3}, Res1. %%================================ %% FacsimileTelephoneNumber %%================================ enc_FacsimileTelephoneNumber(Val) -> enc_FacsimileTelephoneNumber(Val, [<<48>>]). enc_FacsimileTelephoneNumber(Val, TagIn) -> {_,Cindex1,Cindex2} = Val, %%------------------------------------------------- %% attribute telephoneNumber(1) with type PrintableString %%------------------------------------------------- {EncBytes1,EncLen1} = encode_restricted_string(Cindex1, [<<19>>]), %%------------------------------------------------- %% attribute parameters(2) with type BIT STRING OPTIONAL %%------------------------------------------------- {EncBytes2,EncLen2} = case Cindex2 of asn1_NOVALUE -> {<<>>,0}; _ -> encode_named_bit_string(Cindex2, [{'two-dimensional',8},{'fine-resolution',9},{'unlimited-length',20},{'b4-length',21},{'a3-width',22},{'b4-width',23},{'t6-coding',25},{uncompressed,30},{'width-middle-864-of-1728',37},{'width-middle-1216-of-1728',38},{'resolution-type',44},{'resolution-400x400',45},{'resolution-300x300',46},{'resolution-8x15',47},{edi,49},{dtm,50},{bft,51},{'mixed-mode',58},{'character-mode',60},{'twelve-bits',65},{'preferred-huffmann',66},{'full-colour',67},{jpeg,68},{'processable-mode-26',71}], [<<3>>]) end, BytesSoFar = [EncBytes1, EncBytes2], LenSoFar = EncLen1 + EncLen2, encode_tags(TagIn, BytesSoFar, LenSoFar). dec_FacsimileTelephoneNumber(Tlv) -> dec_FacsimileTelephoneNumber(Tlv, [16]). dec_FacsimileTelephoneNumber(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), %%------------------------------------------------- %% attribute telephoneNumber(1) with type PrintableString %%------------------------------------------------- [V1|Tlv2] = Tlv1, Term1 = begin Val1 = decode_restricted_string(V1, [19]), C1 = byte_size(Val1), if 1 =< C1, C1 =< 32 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end, %%------------------------------------------------- %% attribute parameters(2) with type BIT STRING OPTIONAL %%------------------------------------------------- {Term2,Tlv3} = case Tlv2 of [{3,V2}|TempTlv3] -> {decode_named_bit_string(V2, [{'two-dimensional',8},{'fine-resolution',9},{'unlimited-length',20},{'b4-length',21},{'a3-width',22},{'b4-width',23},{'t6-coding',25},{uncompressed,30},{'width-middle-864-of-1728',37},{'width-middle-1216-of-1728',38},{'resolution-type',44},{'resolution-400x400',45},{'resolution-300x300',46},{'resolution-8x15',47},{edi,49},{dtm,50},{bft,51},{'mixed-mode',58},{'character-mode',60},{'twelve-bits',65},{'preferred-huffmann',66},{'full-colour',67},{jpeg,68},{'processable-mode-26',71}], []), TempTlv3}; _ -> { asn1_NOVALUE, Tlv2} end, case Tlv3 of [] -> true;_ -> exit({error,{asn1, {unexpected,Tlv3}}}) % extra fields not allowed end, Res1 = {'FacsimileTelephoneNumber',Term1,Term2}, Res1. %%================================ %% X121Address %%================================ enc_X121Address(Val) -> enc_X121Address(Val, [<<18>>]). enc_X121Address(Val, TagIn) -> encode_restricted_string(Val, TagIn). dec_X121Address(Tlv) -> dec_X121Address(Tlv, [18]). dec_X121Address(Tlv, TagIn) -> begin Val1 = decode_restricted_string(Tlv, TagIn), C1 = byte_size(Val1), if 1 =< C1, C1 =< 15 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end. %%================================ %% InternationalISDNNumber %%================================ enc_InternationalISDNNumber(Val) -> enc_InternationalISDNNumber(Val, [<<18>>]). enc_InternationalISDNNumber(Val, TagIn) -> encode_restricted_string(Val, TagIn). dec_InternationalISDNNumber(Tlv) -> dec_InternationalISDNNumber(Tlv, [18]). dec_InternationalISDNNumber(Tlv, TagIn) -> begin Val1 = decode_restricted_string(Tlv, TagIn), C1 = byte_size(Val1), if 1 =< C1, C1 =< 16 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end. %%================================ %% DestinationIndicator %%================================ enc_DestinationIndicator(Val) -> enc_DestinationIndicator(Val, [<<19>>]). enc_DestinationIndicator(Val, TagIn) -> encode_restricted_string(Val, TagIn). dec_DestinationIndicator(Tlv) -> dec_DestinationIndicator(Tlv, [19]). dec_DestinationIndicator(Tlv, TagIn) -> begin Val1 = decode_restricted_string(Tlv, TagIn), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end. %%================================ %% PreferredDeliveryMethod %%================================ enc_PreferredDeliveryMethod(Val) -> enc_PreferredDeliveryMethod(Val, [<<48>>]). enc_PreferredDeliveryMethod(Val, TagIn) -> {EncBytes,EncLen} = 'enc_PreferredDeliveryMethod_components'(Val,[],0), encode_tags(TagIn, EncBytes, EncLen). 'enc_PreferredDeliveryMethod_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen}; 'enc_PreferredDeliveryMethod_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = encode_integer(H, [{'any-delivery-method',0},{'mhs-delivery',1},{'physical-delivery',2},{'telex-delivery',3},{'teletex-delivery',4},{'g3-facsimile-delivery',5},{'g4-facsimile-delivery',6},{'ia5-terminal-delivery',7},{'videotex-delivery',8},{'telephone-delivery',9}], [<<2>>]), 'enc_PreferredDeliveryMethod_components'(T,[EncBytes|AccBytes], AccLen + EncLen). dec_PreferredDeliveryMethod(Tlv) -> dec_PreferredDeliveryMethod(Tlv, [16]). dec_PreferredDeliveryMethod(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), [begin Val1 = decode_integer(V1, [2]), number2name(Val1, [{'any-delivery-method',0},{'mhs-delivery',1},{'physical-delivery',2},{'telex-delivery',3},{'teletex-delivery',4},{'g3-facsimile-delivery',5},{'g4-facsimile-delivery',6},{'ia5-terminal-delivery',7},{'videotex-delivery',8},{'telephone-delivery',9}]) end || V1 <- Tlv1]. %%================================ %% PresentationAddress %%================================ enc_PresentationAddress(Val) -> enc_PresentationAddress(Val, [<<48>>]). enc_PresentationAddress(Val, TagIn) -> {_,Cindex1,Cindex2,Cindex3,Cindex4} = Val, %%------------------------------------------------- %% attribute pSelector(1) with type OCTET STRING OPTIONAL %%------------------------------------------------- {EncBytes1,EncLen1} = case Cindex1 of asn1_NOVALUE -> {<<>>,0}; _ -> encode_restricted_string(Cindex1, [<<4>>,<<160>>]) end, %%------------------------------------------------- %% attribute sSelector(2) with type OCTET STRING OPTIONAL %%------------------------------------------------- {EncBytes2,EncLen2} = case Cindex2 of asn1_NOVALUE -> {<<>>,0}; _ -> encode_restricted_string(Cindex2, [<<4>>,<<161>>]) end, %%------------------------------------------------- %% attribute tSelector(3) with type OCTET STRING OPTIONAL %%------------------------------------------------- {EncBytes3,EncLen3} = case Cindex3 of asn1_NOVALUE -> {<<>>,0}; _ -> encode_restricted_string(Cindex3, [<<4>>,<<162>>]) end, %%------------------------------------------------- %% attribute nAddresses(4) with type SET OF %%------------------------------------------------- {EncBytes4,EncLen4} = 'enc_PresentationAddress_nAddresses'(Cindex4, [<<49>>,<<163>>]), BytesSoFar = [EncBytes1, EncBytes2, EncBytes3, EncBytes4], LenSoFar = EncLen1 + EncLen2 + EncLen3 + EncLen4, encode_tags(TagIn, BytesSoFar, LenSoFar). %%================================ %% PresentationAddress_nAddresses %%================================ enc_PresentationAddress_nAddresses(Val, TagIn) -> {EncBytes,EncLen} = 'enc_PresentationAddress_nAddresses_components'(Val,[],0), encode_tags(TagIn, EncBytes, EncLen). 'enc_PresentationAddress_nAddresses_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen}; 'enc_PresentationAddress_nAddresses_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = encode_restricted_string(H, [<<4>>]), 'enc_PresentationAddress_nAddresses_components'(T,[EncBytes|AccBytes], AccLen + EncLen). dec_PresentationAddress(Tlv) -> dec_PresentationAddress(Tlv, [16]). dec_PresentationAddress(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), %%------------------------------------------------- %% attribute pSelector(1) with type OCTET STRING OPTIONAL %%------------------------------------------------- {Term1,Tlv2} = case Tlv1 of [{131072,V1}|TempTlv2] -> {decode_octet_string(V1, [4]), TempTlv2}; _ -> { asn1_NOVALUE, Tlv1} end, %%------------------------------------------------- %% attribute sSelector(2) with type OCTET STRING OPTIONAL %%------------------------------------------------- {Term2,Tlv3} = case Tlv2 of [{131073,V2}|TempTlv3] -> {decode_octet_string(V2, [4]), TempTlv3}; _ -> { asn1_NOVALUE, Tlv2} end, %%------------------------------------------------- %% attribute tSelector(3) with type OCTET STRING OPTIONAL %%------------------------------------------------- {Term3,Tlv4} = case Tlv3 of [{131074,V3}|TempTlv4] -> {decode_octet_string(V3, [4]), TempTlv4}; _ -> { asn1_NOVALUE, Tlv3} end, %%------------------------------------------------- %% attribute nAddresses(4) with type SET OF %%------------------------------------------------- [V4|Tlv5] = Tlv4, Term4 = 'dec_PresentationAddress_nAddresses'(V4, [131075,17]), case Tlv5 of [] -> true;_ -> exit({error,{asn1, {unexpected,Tlv5}}}) % extra fields not allowed end, Res1 = {'PresentationAddress',Term1,Term2,Term3,Term4}, Res1. 'dec_PresentationAddress_nAddresses'(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), [decode_octet_string(V1, [4]) || V1 <- Tlv1]. %%================================ %% ProtocolInformation %%================================ enc_ProtocolInformation(Val) -> enc_ProtocolInformation(Val, [<<48>>]). enc_ProtocolInformation(Val, TagIn) -> {_,Cindex1,Cindex2} = Val, %%------------------------------------------------- %% attribute nAddress(1) with type OCTET STRING %%------------------------------------------------- {EncBytes1,EncLen1} = encode_restricted_string(Cindex1, [<<4>>]), %%------------------------------------------------- %% attribute profiles(2) with type SET OF %%------------------------------------------------- {EncBytes2,EncLen2} = 'enc_ProtocolInformation_profiles'(Cindex2, [<<49>>]), BytesSoFar = [EncBytes1, EncBytes2], LenSoFar = EncLen1 + EncLen2, encode_tags(TagIn, BytesSoFar, LenSoFar). %%================================ %% ProtocolInformation_profiles %%================================ enc_ProtocolInformation_profiles(Val, TagIn) -> {EncBytes,EncLen} = 'enc_ProtocolInformation_profiles_components'(Val,[],0), encode_tags(TagIn, EncBytes, EncLen). 'enc_ProtocolInformation_profiles_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen}; 'enc_ProtocolInformation_profiles_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = encode_object_identifier(H, [<<6>>]), 'enc_ProtocolInformation_profiles_components'(T,[EncBytes|AccBytes], AccLen + EncLen). dec_ProtocolInformation(Tlv) -> dec_ProtocolInformation(Tlv, [16]). dec_ProtocolInformation(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), %%------------------------------------------------- %% attribute nAddress(1) with type OCTET STRING %%------------------------------------------------- [V1|Tlv2] = Tlv1, Term1 = decode_octet_string(V1, [4]), %%------------------------------------------------- %% attribute profiles(2) with type SET OF %%------------------------------------------------- [V2|Tlv3] = Tlv2, Term2 = 'dec_ProtocolInformation_profiles'(V2, [17]), case Tlv3 of [] -> true;_ -> exit({error,{asn1, {unexpected,Tlv3}}}) % extra fields not allowed end, Res1 = {'ProtocolInformation',Term1,Term2}, Res1. 'dec_ProtocolInformation_profiles'(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), [decode_object_identifier(V1, [6]) || V1 <- Tlv1]. %%================================ %% NameAndOptionalUID %%================================ enc_NameAndOptionalUID(Val) -> enc_NameAndOptionalUID(Val, [<<48>>]). enc_NameAndOptionalUID(Val, TagIn) -> {_,Cindex1,Cindex2} = Val, %%------------------------------------------------- %% attribute dn(1) External InformationFramework:DistinguishedName %%------------------------------------------------- {EncBytes1,EncLen1} = 'InformationFramework':'enc_DistinguishedName'(Cindex1, [<<48>>]), %%------------------------------------------------- %% attribute uid(2) with type BIT STRING OPTIONAL %%------------------------------------------------- {EncBytes2,EncLen2} = case Cindex2 of asn1_NOVALUE -> {<<>>,0}; _ -> encode_unnamed_bit_string(Cindex2, [<<3>>]) end, BytesSoFar = [EncBytes1, EncBytes2], LenSoFar = EncLen1 + EncLen2, encode_tags(TagIn, BytesSoFar, LenSoFar). dec_NameAndOptionalUID(Tlv) -> dec_NameAndOptionalUID(Tlv, [16]). dec_NameAndOptionalUID(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), %%------------------------------------------------- %% attribute dn(1) External InformationFramework:DistinguishedName %%------------------------------------------------- [V1|Tlv2] = Tlv1, Term1 = 'InformationFramework':'dec_DistinguishedName'(V1, [16]), %%------------------------------------------------- %% attribute uid(2) with type BIT STRING OPTIONAL %%------------------------------------------------- {Term2,Tlv3} = case Tlv2 of [{3,V2}|TempTlv3] -> {decode_native_bit_string(V2, []), TempTlv3}; _ -> { asn1_NOVALUE, Tlv2} end, case Tlv3 of [] -> true;_ -> exit({error,{asn1, {unexpected,Tlv3}}}) % extra fields not allowed end, Res1 = {'NameAndOptionalUID',Term1,Term2}, Res1. %%================================ %% MultipleMatchingLocalities %%================================ enc_MultipleMatchingLocalities(Val) -> enc_MultipleMatchingLocalities(Val, [<<48>>]). enc_MultipleMatchingLocalities(Val, TagIn) -> {_,Cindex1,Cindex2} = Val, %%------------------------------------------------- %% attribute matchingRuleUsed(1) with type OBJECT IDENTIFIER OPTIONAL %%------------------------------------------------- {EncBytes1,EncLen1} = case Cindex1 of asn1_NOVALUE -> {<<>>,0}; _ -> encode_object_identifier(Cindex1, [<<6>>]) end, %%------------------------------------------------- %% attribute attributeList(2) with type SEQUENCE OF %%------------------------------------------------- {EncBytes2,EncLen2} = 'enc_MultipleMatchingLocalities_attributeList'(Cindex2, [<<48>>]), BytesSoFar = [EncBytes1, EncBytes2], LenSoFar = EncLen1 + EncLen2, encode_tags(TagIn, BytesSoFar, LenSoFar). %%================================ %% MultipleMatchingLocalities_attributeList %%================================ enc_MultipleMatchingLocalities_attributeList(Val, TagIn) -> {EncBytes,EncLen} = 'enc_MultipleMatchingLocalities_attributeList_components'(Val,[],0), encode_tags(TagIn, EncBytes, EncLen). 'enc_MultipleMatchingLocalities_attributeList_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen}; 'enc_MultipleMatchingLocalities_attributeList_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = 'InformationFramework':'enc_AttributeValueAssertion'(H, [<<48>>]), 'enc_MultipleMatchingLocalities_attributeList_components'(T,[EncBytes|AccBytes], AccLen + EncLen). dec_MultipleMatchingLocalities(Tlv) -> dec_MultipleMatchingLocalities(Tlv, [16]). dec_MultipleMatchingLocalities(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), %%------------------------------------------------- %% attribute matchingRuleUsed(1) with type OBJECT IDENTIFIER OPTIONAL %%------------------------------------------------- {Term1,Tlv2} = case Tlv1 of [{6,V1}|TempTlv2] -> {decode_object_identifier(V1, []), TempTlv2}; _ -> { asn1_NOVALUE, Tlv1} end, %%------------------------------------------------- %% attribute attributeList(2) with type SEQUENCE OF %%------------------------------------------------- [V2|Tlv3] = Tlv2, Term2 = 'dec_MultipleMatchingLocalities_attributeList'(V2, [16]), case Tlv3 of [] -> true;_ -> exit({error,{asn1, {unexpected,Tlv3}}}) % extra fields not allowed end, Res1 = {'MultipleMatchingLocalities',Term1,Term2}, Res1. 'dec_MultipleMatchingLocalities_attributeList'(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), ['InformationFramework':'dec_AttributeValueAssertion'(V1, [16]) || V1 <- Tlv1]. %%================================ %% SubstringAssertion %%================================ enc_SubstringAssertion(Val) -> enc_SubstringAssertion(Val, [<<48>>]). enc_SubstringAssertion(Val, TagIn) -> {EncBytes,EncLen} = 'enc_SubstringAssertion_components'(Val,[],0), encode_tags(TagIn, EncBytes, EncLen). 'enc_SubstringAssertion_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen}; 'enc_SubstringAssertion_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = 'enc_SubstringAssertion_SEQOF'(H, []), 'enc_SubstringAssertion_components'(T,[EncBytes|AccBytes], AccLen + EncLen). %%================================ %% SubstringAssertion_SEQOF %%================================ enc_SubstringAssertion_SEQOF(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of initial -> 'enc_SubstringAssertion_SEQOF_initial'(element(2,Val), [<<160>>]); any -> 'enc_SubstringAssertion_SEQOF_any'(element(2,Val), [<<161>>]); final -> 'enc_SubstringAssertion_SEQOF_final'(element(2,Val), [<<162>>]); control -> 'InformationFramework':'enc_Attribute'(element(2,Val), [<<48>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). %%================================ %% SubstringAssertion_SEQOF_initial %%================================ enc_SubstringAssertion_SEQOF_initial(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). %%================================ %% SubstringAssertion_SEQOF_any %%================================ enc_SubstringAssertion_SEQOF_any(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). %%================================ %% SubstringAssertion_SEQOF_final %%================================ enc_SubstringAssertion_SEQOF_final(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_SubstringAssertion(Tlv) -> dec_SubstringAssertion(Tlv, [16]). dec_SubstringAssertion(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), ['dec_SubstringAssertion_SEQOF'(V1, []) || V1 <- Tlv1]. 'dec_SubstringAssertion_SEQOF'(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'initial' {131072, V1} -> {initial, 'dec_SubstringAssertion_SEQOF_initial'(V1, [])}; %% 'any' {131073, V1} -> {any, 'dec_SubstringAssertion_SEQOF_any'(V1, [])}; %% 'final' {131074, V1} -> {final, 'dec_SubstringAssertion_SEQOF_final'(V1, [])}; %% 'control' {16, V1} -> {control, 'InformationFramework':'dec_Attribute'(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . 'dec_SubstringAssertion_SEQOF_initial'(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . 'dec_SubstringAssertion_SEQOF_any'(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . 'dec_SubstringAssertion_SEQOF_final'(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% CaseIgnoreListMatch %%================================ enc_CaseIgnoreListMatch(Val) -> enc_CaseIgnoreListMatch(Val, [<<48>>]). enc_CaseIgnoreListMatch(Val, TagIn) -> {EncBytes,EncLen} = 'enc_CaseIgnoreListMatch_components'(Val,[],0), encode_tags(TagIn, EncBytes, EncLen). 'enc_CaseIgnoreListMatch_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen}; 'enc_CaseIgnoreListMatch_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = 'enc_CaseIgnoreListMatch_SEQOF'(H, []), 'enc_CaseIgnoreListMatch_components'(T,[EncBytes|AccBytes], AccLen + EncLen). %%================================ %% CaseIgnoreListMatch_SEQOF %%================================ enc_CaseIgnoreListMatch_SEQOF(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_CaseIgnoreListMatch(Tlv) -> dec_CaseIgnoreListMatch(Tlv, [16]). dec_CaseIgnoreListMatch(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), ['dec_CaseIgnoreListMatch_SEQOF'(V1, []) || V1 <- Tlv1]. 'dec_CaseIgnoreListMatch_SEQOF'(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% OctetSubstringAssertion %%================================ enc_OctetSubstringAssertion(Val) -> enc_OctetSubstringAssertion(Val, [<<48>>]). enc_OctetSubstringAssertion(Val, TagIn) -> {EncBytes,EncLen} = 'enc_OctetSubstringAssertion_components'(Val,[],0), encode_tags(TagIn, EncBytes, EncLen). 'enc_OctetSubstringAssertion_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen}; 'enc_OctetSubstringAssertion_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = 'enc_OctetSubstringAssertion_SEQOF'(H, []), 'enc_OctetSubstringAssertion_components'(T,[EncBytes|AccBytes], AccLen + EncLen). %%================================ %% OctetSubstringAssertion_SEQOF %%================================ enc_OctetSubstringAssertion_SEQOF(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of initial -> encode_restricted_string(element(2,Val), [<<4>>,<<160>>]); any -> encode_restricted_string(element(2,Val), [<<4>>,<<161>>]); final -> encode_restricted_string(element(2,Val), [<<4>>,<<162>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_OctetSubstringAssertion(Tlv) -> dec_OctetSubstringAssertion(Tlv, [16]). dec_OctetSubstringAssertion(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), ['dec_OctetSubstringAssertion_SEQOF'(V1, []) || V1 <- Tlv1]. 'dec_OctetSubstringAssertion_SEQOF'(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'initial' {131072, V1} -> {initial, decode_octet_string(V1, [4])}; %% 'any' {131073, V1} -> {any, decode_octet_string(V1, [4])}; %% 'final' {131074, V1} -> {final, decode_octet_string(V1, [4])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% ZonalSelect %%================================ enc_ZonalSelect(Val) -> enc_ZonalSelect(Val, [<<48>>]). enc_ZonalSelect(Val, TagIn) -> {EncBytes,EncLen} = 'enc_ZonalSelect_components'(Val,[],0), encode_tags(TagIn, EncBytes, EncLen). 'enc_ZonalSelect_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen}; 'enc_ZonalSelect_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = encode_object_identifier(H, [<<6>>]), 'enc_ZonalSelect_components'(T,[EncBytes|AccBytes], AccLen + EncLen). dec_ZonalSelect(Tlv) -> dec_ZonalSelect(Tlv, [16]). dec_ZonalSelect(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), [decode_object_identifier(V1, [6]) || V1 <- Tlv1]. %%================================ %% ZonalResult %%================================ enc_ZonalResult(Val) -> enc_ZonalResult(Val, [<<10>>]). enc_ZonalResult(Val, TagIn) -> case Val of 'cannot-select-mapping' -> encode_tags(TagIn, [0], 1); 'zero-mappings' -> encode_tags(TagIn, [2], 1); 'multiple-mappings' -> encode_tags(TagIn, [3], 1); Enumval1 -> exit({error,{asn1, {enumerated_not_in_range,Enumval1}}}) end. dec_ZonalResult(Tlv) -> dec_ZonalResult(Tlv, [10]). dec_ZonalResult(Tlv, TagIn) -> case decode_integer(Tlv, TagIn) of 0 -> 'cannot-select-mapping'; 2 -> 'zero-mappings'; 3 -> 'multiple-mappings'; Default1 -> exit({error,{asn1,{illegal_enumerated,Default1}}}) end. %%================================ %% LanguageContextSyntax %%================================ enc_LanguageContextSyntax(Val) -> enc_LanguageContextSyntax(Val, [<<19>>]). enc_LanguageContextSyntax(Val, TagIn) -> encode_restricted_string(Val, TagIn). dec_LanguageContextSyntax(Tlv) -> dec_LanguageContextSyntax(Tlv, [19]). dec_LanguageContextSyntax(Tlv, TagIn) -> begin Val1 = decode_restricted_string(Tlv, TagIn), C1 = byte_size(Val1), if 2 =< C1, C1 =< 3 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end. %%================================ %% TimeSpecification %%================================ enc_TimeSpecification(Val) -> enc_TimeSpecification(Val, [<<48>>]). enc_TimeSpecification(Val, TagIn) -> {_,Cindex1,Cindex2,Cindex3} = Val, %%------------------------------------------------- %% attribute time(1) with type CHOICE %%------------------------------------------------- {EncBytes1,EncLen1} = 'enc_TimeSpecification_time'(Cindex1, []), %%------------------------------------------------- %% attribute notThisTime(2) with type BOOLEAN DEFAULT = false %%------------------------------------------------- {EncBytes2,EncLen2} = case Cindex2 of asn1_DEFAULT -> {<<>>,0}; _ when Cindex2 =:= false -> {<<>>,0}; _ -> encode_boolean(Cindex2, [<<1>>]) end, %%------------------------------------------------- %% attribute timeZone(3) with type INTEGER OPTIONAL %%------------------------------------------------- {EncBytes3,EncLen3} = case Cindex3 of asn1_NOVALUE -> {<<>>,0}; _ -> encode_integer(Cindex3, [<<2>>]) end, BytesSoFar = [EncBytes1, EncBytes2, EncBytes3], LenSoFar = EncLen1 + EncLen2 + EncLen3, encode_tags(TagIn, BytesSoFar, LenSoFar). %%================================ %% TimeSpecification_time %%================================ enc_TimeSpecification_time(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of absolute -> 'enc_TimeSpecification_time_absolute'(element(2,Val), [<<48>>]); periodic -> 'enc_TimeSpecification_time_periodic'(element(2,Val), [<<49>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). %%================================ %% TimeSpecification_time_absolute %%================================ enc_TimeSpecification_time_absolute(Val, TagIn) -> {_,Cindex1,Cindex2} = Val, %%------------------------------------------------- %% attribute startTime(1) with type GeneralizedTime OPTIONAL %%------------------------------------------------- {EncBytes1,EncLen1} = case Cindex1 of asn1_NOVALUE -> {<<>>,0}; _ -> encode_restricted_string(Cindex1, [<<24>>,<<160>>]) end, %%------------------------------------------------- %% attribute endTime(2) with type GeneralizedTime OPTIONAL %%------------------------------------------------- {EncBytes2,EncLen2} = case Cindex2 of asn1_NOVALUE -> {<<>>,0}; _ -> encode_restricted_string(Cindex2, [<<24>>,<<161>>]) end, BytesSoFar = [EncBytes1, EncBytes2], LenSoFar = EncLen1 + EncLen2, encode_tags(TagIn, BytesSoFar, LenSoFar). %%================================ %% TimeSpecification_time_periodic %%================================ enc_TimeSpecification_time_periodic(Val, TagIn) -> {EncBytes,EncLen} = 'enc_TimeSpecification_time_periodic_components'(Val,[],0), encode_tags(TagIn, EncBytes, EncLen). 'enc_TimeSpecification_time_periodic_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen}; 'enc_TimeSpecification_time_periodic_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = 'enc_Period'(H, [<<48>>]), 'enc_TimeSpecification_time_periodic_components'(T,[EncBytes|AccBytes], AccLen + EncLen). dec_TimeSpecification(Tlv) -> dec_TimeSpecification(Tlv, [16]). dec_TimeSpecification(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), %%------------------------------------------------- %% attribute time(1) with type CHOICE %%------------------------------------------------- [V1|Tlv2] = Tlv1, Term1 = 'dec_TimeSpecification_time'(V1, []), %%------------------------------------------------- %% attribute notThisTime(2) with type BOOLEAN DEFAULT = false %%------------------------------------------------- {Term2,Tlv3} = case Tlv2 of [{1,V2}|TempTlv3] -> {decode_boolean(V2, []), TempTlv3}; _ -> {false,Tlv2} end, %%------------------------------------------------- %% attribute timeZone(3) with type INTEGER OPTIONAL %%------------------------------------------------- {Term3,Tlv4} = case Tlv3 of [{2,V3}|TempTlv4] -> {begin Val1 = decode_integer(V3, []), if -12 =< Val1, Val1 =< 12 -> Val1; true -> exit({error,{asn1,bad_range}}) end end, TempTlv4}; _ -> { asn1_NOVALUE, Tlv3} end, case Tlv4 of [] -> true;_ -> exit({error,{asn1, {unexpected,Tlv4}}}) % extra fields not allowed end, Res1 = {'TimeSpecification',Term1,Term2,Term3}, Res1. 'dec_TimeSpecification_time'(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'absolute' {16, V1} -> {absolute, 'dec_TimeSpecification_time_absolute'(V1, [])}; %% 'periodic' {17, V1} -> {periodic, 'dec_TimeSpecification_time_periodic'(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . 'dec_TimeSpecification_time_absolute'(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), %%------------------------------------------------- %% attribute startTime(1) with type GeneralizedTime OPTIONAL %%------------------------------------------------- {Term1,Tlv2} = case Tlv1 of [{131072,V1}|TempTlv2] -> {begin binary_to_list(decode_restricted_string(V1, [24])) end , TempTlv2}; _ -> { asn1_NOVALUE, Tlv1} end, %%------------------------------------------------- %% attribute endTime(2) with type GeneralizedTime OPTIONAL %%------------------------------------------------- {Term2,Tlv3} = case Tlv2 of [{131073,V2}|TempTlv3] -> {begin binary_to_list(decode_restricted_string(V2, [24])) end , TempTlv3}; _ -> { asn1_NOVALUE, Tlv2} end, case Tlv3 of [] -> true;_ -> exit({error,{asn1, {unexpected,Tlv3}}}) % extra fields not allowed end, Res1 = {'TimeSpecification_time_absolute',Term1,Term2}, Res1. 'dec_TimeSpecification_time_periodic'(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), ['dec_Period'(V1, [16]) || V1 <- Tlv1]. %%================================ %% Period %%================================ enc_Period(Val) -> enc_Period(Val, [<<48>>]). enc_Period(Val, TagIn) -> {_,Cindex1,Cindex2,Cindex3,Cindex4,Cindex5} = Val, %%------------------------------------------------- %% attribute timesOfDay(1) with type SET OF OPTIONAL %%------------------------------------------------- {EncBytes1,EncLen1} = case Cindex1 of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_Period_timesOfDay'(Cindex1, [<<49>>,<<160>>]) end, %%------------------------------------------------- %% attribute days(2) with type CHOICE OPTIONAL %%------------------------------------------------- {EncBytes2,EncLen2} = case Cindex2 of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_Period_days'(Cindex2, [<<161>>]) end, %%------------------------------------------------- %% attribute weeks(3) with type CHOICE OPTIONAL %%------------------------------------------------- {EncBytes3,EncLen3} = case Cindex3 of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_Period_weeks'(Cindex3, [<<162>>]) end, %%------------------------------------------------- %% attribute months(4) with type CHOICE OPTIONAL %%------------------------------------------------- {EncBytes4,EncLen4} = case Cindex4 of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_Period_months'(Cindex4, [<<163>>]) end, %%------------------------------------------------- %% attribute years(5) with type SET OF OPTIONAL %%------------------------------------------------- {EncBytes5,EncLen5} = case Cindex5 of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_Period_years'(Cindex5, [<<49>>,<<164>>]) end, BytesSoFar = [EncBytes1, EncBytes2, EncBytes3, EncBytes4, EncBytes5], LenSoFar = EncLen1 + EncLen2 + EncLen3 + EncLen4 + EncLen5, encode_tags(TagIn, BytesSoFar, LenSoFar). %%================================ %% Period_timesOfDay %%================================ enc_Period_timesOfDay(Val, TagIn) -> {EncBytes,EncLen} = 'enc_Period_timesOfDay_components'(Val,[],0), encode_tags(TagIn, EncBytes, EncLen). 'enc_Period_timesOfDay_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen}; 'enc_Period_timesOfDay_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = 'enc_DayTimeBand'(H, [<<48>>]), 'enc_Period_timesOfDay_components'(T,[EncBytes|AccBytes], AccLen + EncLen). %%================================ %% Period_days %%================================ enc_Period_days(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of intDay -> 'enc_Period_days_intDay'(element(2,Val), [<<49>>]); bitDay -> encode_named_bit_string(element(2,Val), [{sunday,0},{monday,1},{tuesday,2},{wednesday,3},{thursday,4},{friday,5},{saturday,6}], [<<3>>]); dayOf -> 'enc_XDayOf'(element(2,Val), []); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). %%================================ %% Period_days_intDay %%================================ enc_Period_days_intDay(Val, TagIn) -> {EncBytes,EncLen} = 'enc_Period_days_intDay_components'(Val,[],0), encode_tags(TagIn, EncBytes, EncLen). 'enc_Period_days_intDay_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen}; 'enc_Period_days_intDay_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = encode_integer(H, [<<2>>]), 'enc_Period_days_intDay_components'(T,[EncBytes|AccBytes], AccLen + EncLen). %%================================ %% Period_weeks %%================================ enc_Period_weeks(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of allWeeks -> encode_null(element(2,Val), [<<5>>]); intWeek -> 'enc_Period_weeks_intWeek'(element(2,Val), [<<49>>]); bitWeek -> encode_named_bit_string(element(2,Val), [{week1,0},{week2,1},{week3,2},{week4,3},{week5,4}], [<<3>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). %%================================ %% Period_weeks_intWeek %%================================ enc_Period_weeks_intWeek(Val, TagIn) -> {EncBytes,EncLen} = 'enc_Period_weeks_intWeek_components'(Val,[],0), encode_tags(TagIn, EncBytes, EncLen). 'enc_Period_weeks_intWeek_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen}; 'enc_Period_weeks_intWeek_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = encode_integer(H, [<<2>>]), 'enc_Period_weeks_intWeek_components'(T,[EncBytes|AccBytes], AccLen + EncLen). %%================================ %% Period_months %%================================ enc_Period_months(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of allMonths -> encode_null(element(2,Val), [<<5>>]); intMonth -> 'enc_Period_months_intMonth'(element(2,Val), [<<49>>]); bitMonth -> encode_named_bit_string(element(2,Val), [{january,0},{february,1},{march,2},{april,3},{may,4},{june,5},{july,6},{august,7},{september,8},{october,9},{november,10},{december,11}], [<<3>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). %%================================ %% Period_months_intMonth %%================================ enc_Period_months_intMonth(Val, TagIn) -> {EncBytes,EncLen} = 'enc_Period_months_intMonth_components'(Val,[],0), encode_tags(TagIn, EncBytes, EncLen). 'enc_Period_months_intMonth_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen}; 'enc_Period_months_intMonth_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = encode_integer(H, [<<2>>]), 'enc_Period_months_intMonth_components'(T,[EncBytes|AccBytes], AccLen + EncLen). %%================================ %% Period_years %%================================ enc_Period_years(Val, TagIn) -> {EncBytes,EncLen} = 'enc_Period_years_components'(Val,[],0), encode_tags(TagIn, EncBytes, EncLen). 'enc_Period_years_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen}; 'enc_Period_years_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = encode_integer(H, [<<2>>]), 'enc_Period_years_components'(T,[EncBytes|AccBytes], AccLen + EncLen). dec_Period(Tlv) -> dec_Period(Tlv, [16]). dec_Period(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), %%------------------------------------------------- %% attribute timesOfDay(1) with type SET OF OPTIONAL %%------------------------------------------------- {Term1,Tlv2} = case Tlv1 of [{131072,V1}|TempTlv2] -> {'dec_Period_timesOfDay'(V1, [17]), TempTlv2}; _ -> { asn1_NOVALUE, Tlv1} end, %%------------------------------------------------- %% attribute days(2) with type CHOICE OPTIONAL %%------------------------------------------------- {Term2,Tlv3} = case Tlv2 of [{131073,V2}|TempTlv3] -> {'dec_Period_days'(V2, []), TempTlv3}; _ -> { asn1_NOVALUE, Tlv2} end, %%------------------------------------------------- %% attribute weeks(3) with type CHOICE OPTIONAL %%------------------------------------------------- {Term3,Tlv4} = case Tlv3 of [{131074,V3}|TempTlv4] -> {'dec_Period_weeks'(V3, []), TempTlv4}; _ -> { asn1_NOVALUE, Tlv3} end, %%------------------------------------------------- %% attribute months(4) with type CHOICE OPTIONAL %%------------------------------------------------- {Term4,Tlv5} = case Tlv4 of [{131075,V4}|TempTlv5] -> {'dec_Period_months'(V4, []), TempTlv5}; _ -> { asn1_NOVALUE, Tlv4} end, %%------------------------------------------------- %% attribute years(5) with type SET OF OPTIONAL %%------------------------------------------------- {Term5,Tlv6} = case Tlv5 of [{131076,V5}|TempTlv6] -> {'dec_Period_years'(V5, [17]), TempTlv6}; _ -> { asn1_NOVALUE, Tlv5} end, case Tlv6 of [] -> true;_ -> exit({error,{asn1, {unexpected,Tlv6}}}) % extra fields not allowed end, Res1 = {'Period',Term1,Term2,Term3,Term4,Term5}, Res1. 'dec_Period_timesOfDay'(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), ['dec_DayTimeBand'(V1, [16]) || V1 <- Tlv1]. 'dec_Period_days'(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'intDay' {17, V1} -> {intDay, 'dec_Period_days_intDay'(V1, [])}; %% 'bitDay' {3, V1} -> {bitDay, decode_named_bit_string(V1, [{sunday,0},{monday,1},{tuesday,2},{wednesday,3},{thursday,4},{friday,5},{saturday,6}], [])}; %% 'dayOf' V1 = {131073,_} -> {dayOf, 'dec_XDayOf'(V1, [])}; V1 = {131074,_} -> {dayOf, 'dec_XDayOf'(V1, [])}; V1 = {131075,_} -> {dayOf, 'dec_XDayOf'(V1, [])}; V1 = {131076,_} -> {dayOf, 'dec_XDayOf'(V1, [])}; V1 = {131077,_} -> {dayOf, 'dec_XDayOf'(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . 'dec_Period_days_intDay'(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), [decode_integer(V1, [2]) || V1 <- Tlv1]. 'dec_Period_weeks'(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'allWeeks' {5, V1} -> {allWeeks, decode_null(V1, [])}; %% 'intWeek' {17, V1} -> {intWeek, 'dec_Period_weeks_intWeek'(V1, [])}; %% 'bitWeek' {3, V1} -> {bitWeek, decode_named_bit_string(V1, [{week1,0},{week2,1},{week3,2},{week4,3},{week5,4}], [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . 'dec_Period_weeks_intWeek'(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), [decode_integer(V1, [2]) || V1 <- Tlv1]. 'dec_Period_months'(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'allMonths' {5, V1} -> {allMonths, decode_null(V1, [])}; %% 'intMonth' {17, V1} -> {intMonth, 'dec_Period_months_intMonth'(V1, [])}; %% 'bitMonth' {3, V1} -> {bitMonth, decode_named_bit_string(V1, [{january,0},{february,1},{march,2},{april,3},{may,4},{june,5},{july,6},{august,7},{september,8},{october,9},{november,10},{december,11}], [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . 'dec_Period_months_intMonth'(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), [decode_integer(V1, [2]) || V1 <- Tlv1]. 'dec_Period_years'(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), [begin Val1 = decode_integer(V1, [2]), if 1000 =< Val1, Val1 =< 'MAX' -> Val1; true -> exit({error,{asn1,bad_range}}) end end || V1 <- Tlv1]. %%================================ %% XDayOf %%================================ enc_XDayOf(Val) -> enc_XDayOf(Val, []). enc_XDayOf(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of first -> 'enc_NamedDay'(element(2,Val), [<<161>>]); second -> 'enc_NamedDay'(element(2,Val), [<<162>>]); third -> 'enc_NamedDay'(element(2,Val), [<<163>>]); fourth -> 'enc_NamedDay'(element(2,Val), [<<164>>]); fifth -> 'enc_NamedDay'(element(2,Val), [<<165>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_XDayOf(Tlv) -> dec_XDayOf(Tlv, []). dec_XDayOf(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'first' {131073, V1} -> {first, 'dec_NamedDay'(V1, [])}; %% 'second' {131074, V1} -> {second, 'dec_NamedDay'(V1, [])}; %% 'third' {131075, V1} -> {third, 'dec_NamedDay'(V1, [])}; %% 'fourth' {131076, V1} -> {fourth, 'dec_NamedDay'(V1, [])}; %% 'fifth' {131077, V1} -> {fifth, 'dec_NamedDay'(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% NamedDay %%================================ enc_NamedDay(Val) -> enc_NamedDay(Val, []). enc_NamedDay(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of intNamedDays -> case element(2,Val) of sunday -> encode_tags([<<10>>], [1], 1); monday -> encode_tags([<<10>>], [2], 1); tuesday -> encode_tags([<<10>>], [3], 1); wednesday -> encode_tags([<<10>>], [4], 1); thursday -> encode_tags([<<10>>], [5], 1); friday -> encode_tags([<<10>>], [6], 1); saturday -> encode_tags([<<10>>], [7], 1); Enumval1 -> exit({error,{asn1, {enumerated_not_in_range,Enumval1}}}) end; bitNamedDays -> encode_named_bit_string(element(2,Val), [{sunday,0},{monday,1},{tuesday,2},{wednesday,3},{thursday,4},{friday,5},{saturday,6}], [<<3>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_NamedDay(Tlv) -> dec_NamedDay(Tlv, []). dec_NamedDay(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'intNamedDays' {10, V1} -> {intNamedDays, case decode_integer(V1, []) of 1 -> sunday; 2 -> monday; 3 -> tuesday; 4 -> wednesday; 5 -> thursday; 6 -> friday; 7 -> saturday; Default1 -> exit({error,{asn1,{illegal_enumerated,Default1}}}) end}; %% 'bitNamedDays' {3, V1} -> {bitNamedDays, decode_named_bit_string(V1, [{sunday,0},{monday,1},{tuesday,2},{wednesday,3},{thursday,4},{friday,5},{saturday,6}], [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% DayTimeBand %%================================ enc_DayTimeBand(Val) -> enc_DayTimeBand(Val, [<<48>>]). enc_DayTimeBand(Val, TagIn) -> {_,Cindex1,Cindex2} = Val, %%------------------------------------------------- %% attribute startDayTime(1) External SelectedAttributeTypes:DayTime DEFAULT = {'DayTime',0,0,0} %%------------------------------------------------- {EncBytes1,EncLen1} = case Cindex1 of asn1_DEFAULT -> {<<>>,0}; _ when Cindex1 =:= {'DayTime',0,0,0} -> {<<>>,0}; _ -> 'enc_DayTime'(Cindex1, [<<48>>,<<160>>]) end, %%------------------------------------------------- %% attribute endDayTime(2) External SelectedAttributeTypes:DayTime DEFAULT = {'DayTime',23,59,59} %%------------------------------------------------- {EncBytes2,EncLen2} = case Cindex2 of asn1_DEFAULT -> {<<>>,0}; _ when Cindex2 =:= {'DayTime',23,59,59} -> {<<>>,0}; _ -> 'enc_DayTime'(Cindex2, [<<48>>,<<161>>]) end, BytesSoFar = [EncBytes1, EncBytes2], LenSoFar = EncLen1 + EncLen2, encode_tags(TagIn, BytesSoFar, LenSoFar). dec_DayTimeBand(Tlv) -> dec_DayTimeBand(Tlv, [16]). dec_DayTimeBand(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), %%------------------------------------------------- %% attribute startDayTime(1) External SelectedAttributeTypes:DayTime DEFAULT = {'DayTime',0,0,0} %%------------------------------------------------- {Term1,Tlv2} = case Tlv1 of [{131072,V1}|TempTlv2] -> {'dec_DayTime'(V1, [16]), TempTlv2}; _ -> {{'DayTime',0,0,0},Tlv1} end, %%------------------------------------------------- %% attribute endDayTime(2) External SelectedAttributeTypes:DayTime DEFAULT = {'DayTime',23,59,59} %%------------------------------------------------- {Term2,Tlv3} = case Tlv2 of [{131073,V2}|TempTlv3] -> {'dec_DayTime'(V2, [16]), TempTlv3}; _ -> {{'DayTime',23,59,59},Tlv2} end, case Tlv3 of [] -> true;_ -> exit({error,{asn1, {unexpected,Tlv3}}}) % extra fields not allowed end, Res1 = {'DayTimeBand',Term1,Term2}, Res1. %%================================ %% DayTime %%================================ enc_DayTime(Val) -> enc_DayTime(Val, [<<48>>]). enc_DayTime(Val, TagIn) -> {_,Cindex1,Cindex2,Cindex3} = Val, %%------------------------------------------------- %% attribute hour(1) with type INTEGER %%------------------------------------------------- {EncBytes1,EncLen1} = encode_integer(Cindex1, [<<2>>,<<160>>]), %%------------------------------------------------- %% attribute minute(2) with type INTEGER DEFAULT = 0 %%------------------------------------------------- {EncBytes2,EncLen2} = case Cindex2 of asn1_DEFAULT -> {<<>>,0}; _ when Cindex2 =:= 0 -> {<<>>,0}; _ -> encode_integer(Cindex2, [<<2>>,<<161>>]) end, %%------------------------------------------------- %% attribute second(3) with type INTEGER DEFAULT = 0 %%------------------------------------------------- {EncBytes3,EncLen3} = case Cindex3 of asn1_DEFAULT -> {<<>>,0}; _ when Cindex3 =:= 0 -> {<<>>,0}; _ -> encode_integer(Cindex3, [<<2>>,<<162>>]) end, BytesSoFar = [EncBytes1, EncBytes2, EncBytes3], LenSoFar = EncLen1 + EncLen2 + EncLen3, encode_tags(TagIn, BytesSoFar, LenSoFar). dec_DayTime(Tlv) -> dec_DayTime(Tlv, [16]). dec_DayTime(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), %%------------------------------------------------- %% attribute hour(1) with type INTEGER %%------------------------------------------------- [V1|Tlv2] = Tlv1, Term1 = begin Val1 = decode_integer(V1, [131072,2]), if 0 =< Val1, Val1 =< 23 -> Val1; true -> exit({error,{asn1,bad_range}}) end end, %%------------------------------------------------- %% attribute minute(2) with type INTEGER DEFAULT = 0 %%------------------------------------------------- {Term2,Tlv3} = case Tlv2 of [{131073,V2}|TempTlv3] -> {begin Val2 = decode_integer(V2, [2]), if 0 =< Val2, Val2 =< 59 -> Val2; true -> exit({error,{asn1,bad_range}}) end end, TempTlv3}; _ -> {0,Tlv2} end, %%------------------------------------------------- %% attribute second(3) with type INTEGER DEFAULT = 0 %%------------------------------------------------- {Term3,Tlv4} = case Tlv3 of [{131074,V3}|TempTlv4] -> {begin Val3 = decode_integer(V3, [2]), if 0 =< Val3, Val3 =< 59 -> Val3; true -> exit({error,{asn1,bad_range}}) end end, TempTlv4}; _ -> {0,Tlv3} end, case Tlv4 of [] -> true;_ -> exit({error,{asn1, {unexpected,Tlv4}}}) % extra fields not allowed end, Res1 = {'DayTime',Term1,Term2,Term3}, Res1. %%================================ %% TimeZone %%================================ enc_TimeZone(Val) -> enc_TimeZone(Val, [<<2>>]). enc_TimeZone(Val, TagIn) -> encode_integer(Val, TagIn). dec_TimeZone(Tlv) -> dec_TimeZone(Tlv, [2]). dec_TimeZone(Tlv, TagIn) -> begin Val1 = decode_integer(Tlv, TagIn), if -12 =< Val1, Val1 =< 12 -> Val1; true -> exit({error,{asn1,bad_range}}) end end. %%================================ %% TimeAssertion %%================================ enc_TimeAssertion(Val) -> enc_TimeAssertion(Val, []). enc_TimeAssertion(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of now -> encode_null(element(2,Val), [<<5>>]); at -> encode_restricted_string(element(2,Val), [<<24>>]); between -> 'enc_TimeAssertion_between'(element(2,Val), [<<48>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). %%================================ %% TimeAssertion_between %%================================ enc_TimeAssertion_between(Val, TagIn) -> {_,Cindex1,Cindex2,Cindex3} = Val, %%------------------------------------------------- %% attribute startTime(1) with type GeneralizedTime %%------------------------------------------------- {EncBytes1,EncLen1} = encode_restricted_string(Cindex1, [<<24>>,<<160>>]), %%------------------------------------------------- %% attribute endTime(2) with type GeneralizedTime OPTIONAL %%------------------------------------------------- {EncBytes2,EncLen2} = case Cindex2 of asn1_NOVALUE -> {<<>>,0}; _ -> encode_restricted_string(Cindex2, [<<24>>,<<161>>]) end, %%------------------------------------------------- %% attribute entirely(3) with type BOOLEAN DEFAULT = false %%------------------------------------------------- {EncBytes3,EncLen3} = case Cindex3 of asn1_DEFAULT -> {<<>>,0}; _ when Cindex3 =:= false -> {<<>>,0}; _ -> encode_boolean(Cindex3, [<<1>>]) end, BytesSoFar = [EncBytes1, EncBytes2, EncBytes3], LenSoFar = EncLen1 + EncLen2 + EncLen3, encode_tags(TagIn, BytesSoFar, LenSoFar). dec_TimeAssertion(Tlv) -> dec_TimeAssertion(Tlv, []). dec_TimeAssertion(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'now' {5, V1} -> {now, decode_null(V1, [])}; %% 'at' {24, V1} -> {at, begin binary_to_list(decode_restricted_string(V1, [])) end }; %% 'between' {16, V1} -> {between, 'dec_TimeAssertion_between'(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . 'dec_TimeAssertion_between'(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), %%------------------------------------------------- %% attribute startTime(1) with type GeneralizedTime %%------------------------------------------------- [V1|Tlv2] = Tlv1, Term1 = begin binary_to_list(decode_restricted_string(V1, [131072,24])) end , %%------------------------------------------------- %% attribute endTime(2) with type GeneralizedTime OPTIONAL %%------------------------------------------------- {Term2,Tlv3} = case Tlv2 of [{131073,V2}|TempTlv3] -> {begin binary_to_list(decode_restricted_string(V2, [24])) end , TempTlv3}; _ -> { asn1_NOVALUE, Tlv2} end, %%------------------------------------------------- %% attribute entirely(3) with type BOOLEAN DEFAULT = false %%------------------------------------------------- {Term3,Tlv4} = case Tlv3 of [{1,V3}|TempTlv4] -> {decode_boolean(V3, []), TempTlv4}; _ -> {false,Tlv3} end, case Tlv4 of [] -> true;_ -> exit({error,{asn1, {unexpected,Tlv4}}}) % extra fields not allowed end, Res1 = {'TimeAssertion_between',Term1,Term2,Term3}, Res1. %%================================ %% LocaleContextSyntax %%================================ enc_LocaleContextSyntax(Val) -> enc_LocaleContextSyntax(Val, []). enc_LocaleContextSyntax(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of localeID1 -> encode_object_identifier(element(2,Val), [<<6>>]); localeID2 -> 'enc_LocaleContextSyntax_localeID2'(element(2,Val), []); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). %%================================ %% LocaleContextSyntax_localeID2 %%================================ enc_LocaleContextSyntax_localeID2(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_LocaleContextSyntax(Tlv) -> dec_LocaleContextSyntax(Tlv, []). dec_LocaleContextSyntax(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'localeID1' {6, V1} -> {localeID1, decode_object_identifier(V1, [])}; %% 'localeID2' V1 = {20,_} -> {localeID2, 'dec_LocaleContextSyntax_localeID2'(V1, [])}; V1 = {19,_} -> {localeID2, 'dec_LocaleContextSyntax_localeID2'(V1, [])}; V1 = {28,_} -> {localeID2, 'dec_LocaleContextSyntax_localeID2'(V1, [])}; V1 = {30,_} -> {localeID2, 'dec_LocaleContextSyntax_localeID2'(V1, [])}; V1 = {12,_} -> {localeID2, 'dec_LocaleContextSyntax_localeID2'(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . 'dec_LocaleContextSyntax_localeID2'(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% G3FacsimileNonBasicParameters %%================================ enc_G3FacsimileNonBasicParameters(Val) -> enc_G3FacsimileNonBasicParameters(Val, [<<3>>]). enc_G3FacsimileNonBasicParameters(Val, TagIn) -> encode_named_bit_string(Val, [{'two-dimensional',8},{'fine-resolution',9},{'unlimited-length',20},{'b4-length',21},{'a3-width',22},{'b4-width',23},{'t6-coding',25},{uncompressed,30},{'width-middle-864-of-1728',37},{'width-middle-1216-of-1728',38},{'resolution-type',44},{'resolution-400x400',45},{'resolution-300x300',46},{'resolution-8x15',47},{edi,49},{dtm,50},{bft,51},{'mixed-mode',58},{'character-mode',60},{'twelve-bits',65},{'preferred-huffmann',66},{'full-colour',67},{jpeg,68},{'processable-mode-26',71}], TagIn). dec_G3FacsimileNonBasicParameters(Tlv) -> dec_G3FacsimileNonBasicParameters(Tlv, [3]). dec_G3FacsimileNonBasicParameters(Tlv, TagIn) -> decode_named_bit_string(Tlv, [{'two-dimensional',8},{'fine-resolution',9},{'unlimited-length',20},{'b4-length',21},{'a3-width',22},{'b4-width',23},{'t6-coding',25},{uncompressed,30},{'width-middle-864-of-1728',37},{'width-middle-1216-of-1728',38},{'resolution-type',44},{'resolution-400x400',45},{'resolution-300x300',46},{'resolution-8x15',47},{edi,49},{dtm,50},{bft,51},{'mixed-mode',58},{'character-mode',60},{'twelve-bits',65},{'preferred-huffmann',66},{'full-colour',67},{jpeg,68},{'processable-mode-26',71}], TagIn). %%================================ %% organizationName_DirectoryString %%================================ enc_organizationName_DirectoryString(Val) -> enc_organizationName_DirectoryString(Val, []). enc_organizationName_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_organizationName_DirectoryString(Tlv) -> dec_organizationName_DirectoryString(Tlv, []). dec_organizationName_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 64 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 64 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 64 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 64 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% givenName_DirectoryString %%================================ enc_givenName_DirectoryString(Val) -> enc_givenName_DirectoryString(Val, []). enc_givenName_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_givenName_DirectoryString(Tlv) -> dec_givenName_DirectoryString(Tlv, []). dec_givenName_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 64 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 64 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 64 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 64 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% description_DirectoryString %%================================ enc_description_DirectoryString(Val) -> enc_description_DirectoryString(Val, []). enc_description_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_description_DirectoryString(Tlv) -> dec_description_DirectoryString(Tlv, []). dec_description_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% organizationalUnitName_DirectoryString %%================================ enc_organizationalUnitName_DirectoryString(Val) -> enc_organizationalUnitName_DirectoryString(Val, []). enc_organizationalUnitName_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_organizationalUnitName_DirectoryString(Tlv) -> dec_organizationalUnitName_DirectoryString(Tlv, []). dec_organizationalUnitName_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 64 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 64 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 64 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 64 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% caseExactOrderingMatch_DirectoryString %%================================ enc_caseExactOrderingMatch_DirectoryString(Val) -> enc_caseExactOrderingMatch_DirectoryString(Val, []). enc_caseExactOrderingMatch_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_caseExactOrderingMatch_DirectoryString(Tlv) -> dec_caseExactOrderingMatch_DirectoryString(Tlv, []). dec_caseExactOrderingMatch_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% caseIgnoreOrderingMatch_DirectoryString %%================================ enc_caseIgnoreOrderingMatch_DirectoryString(Val) -> enc_caseIgnoreOrderingMatch_DirectoryString(Val, []). enc_caseIgnoreOrderingMatch_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_caseIgnoreOrderingMatch_DirectoryString(Tlv) -> dec_caseIgnoreOrderingMatch_DirectoryString(Tlv, []). dec_caseIgnoreOrderingMatch_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% destinationIndicator_DirectoryString %%================================ enc_destinationIndicator_DirectoryString(Val) -> enc_destinationIndicator_DirectoryString(Val, []). enc_destinationIndicator_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_destinationIndicator_DirectoryString(Tlv) -> dec_destinationIndicator_DirectoryString(Tlv, []). dec_destinationIndicator_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% localityName_DirectoryString %%================================ enc_localityName_DirectoryString(Val) -> enc_localityName_DirectoryString(Val, []). enc_localityName_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_localityName_DirectoryString(Tlv) -> dec_localityName_DirectoryString(Tlv, []). dec_localityName_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% commonName_DirectoryString %%================================ enc_commonName_DirectoryString(Val) -> enc_commonName_DirectoryString(Val, []). enc_commonName_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_commonName_DirectoryString(Tlv) -> dec_commonName_DirectoryString(Tlv, []). dec_commonName_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 64 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 64 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 64 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 64 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% streetAddress_DirectoryString %%================================ enc_streetAddress_DirectoryString(Val) -> enc_streetAddress_DirectoryString(Val, []). enc_streetAddress_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_streetAddress_DirectoryString(Tlv) -> dec_streetAddress_DirectoryString(Tlv, []). dec_streetAddress_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% pseudonym_DirectoryString %%================================ enc_pseudonym_DirectoryString(Val) -> enc_pseudonym_DirectoryString(Val, []). enc_pseudonym_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_pseudonym_DirectoryString(Tlv) -> dec_pseudonym_DirectoryString(Tlv, []). dec_pseudonym_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% generationQualifier_DirectoryString %%================================ enc_generationQualifier_DirectoryString(Val) -> enc_generationQualifier_DirectoryString(Val, []). enc_generationQualifier_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_generationQualifier_DirectoryString(Tlv) -> dec_generationQualifier_DirectoryString(Tlv, []). dec_generationQualifier_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 64 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 64 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 64 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 64 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% storedPrefixMatch_DirectoryString %%================================ enc_storedPrefixMatch_DirectoryString(Val) -> enc_storedPrefixMatch_DirectoryString(Val, []). enc_storedPrefixMatch_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_storedPrefixMatch_DirectoryString(Tlv) -> dec_storedPrefixMatch_DirectoryString(Tlv, []). dec_storedPrefixMatch_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% serialNumber_DirectoryString %%================================ enc_serialNumber_DirectoryString(Val) -> enc_serialNumber_DirectoryString(Val, []). enc_serialNumber_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_serialNumber_DirectoryString(Tlv) -> dec_serialNumber_DirectoryString(Tlv, []). dec_serialNumber_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% wordMatch_DirectoryString %%================================ enc_wordMatch_DirectoryString(Val) -> enc_wordMatch_DirectoryString(Val, []). enc_wordMatch_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_wordMatch_DirectoryString(Tlv) -> dec_wordMatch_DirectoryString(Tlv, []). dec_wordMatch_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% physicalDeliveryOfficeName_DirectoryString %%================================ enc_physicalDeliveryOfficeName_DirectoryString(Val) -> enc_physicalDeliveryOfficeName_DirectoryString(Val, []). enc_physicalDeliveryOfficeName_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_physicalDeliveryOfficeName_DirectoryString(Tlv) -> dec_physicalDeliveryOfficeName_DirectoryString(Tlv, []). dec_physicalDeliveryOfficeName_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% postalCode_DirectoryString %%================================ enc_postalCode_DirectoryString(Val) -> enc_postalCode_DirectoryString(Val, []). enc_postalCode_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_postalCode_DirectoryString(Tlv) -> dec_postalCode_DirectoryString(Tlv, []). dec_postalCode_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% businessCategory_DirectoryString %%================================ enc_businessCategory_DirectoryString(Val) -> enc_businessCategory_DirectoryString(Val, []). enc_businessCategory_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_businessCategory_DirectoryString(Tlv) -> dec_businessCategory_DirectoryString(Tlv, []). dec_businessCategory_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% dnQualifier_DirectoryString %%================================ enc_dnQualifier_DirectoryString(Val) -> enc_dnQualifier_DirectoryString(Val, []). enc_dnQualifier_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_dnQualifier_DirectoryString(Tlv) -> dec_dnQualifier_DirectoryString(Tlv, []). dec_dnQualifier_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% initials_DirectoryString %%================================ enc_initials_DirectoryString(Val) -> enc_initials_DirectoryString(Val, []). enc_initials_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_initials_DirectoryString(Tlv) -> dec_initials_DirectoryString(Tlv, []). dec_initials_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 64 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 64 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 64 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 64 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% postOfficeBox_DirectoryString %%================================ enc_postOfficeBox_DirectoryString(Val) -> enc_postOfficeBox_DirectoryString(Val, []). enc_postOfficeBox_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_postOfficeBox_DirectoryString(Tlv) -> dec_postOfficeBox_DirectoryString(Tlv, []). dec_postOfficeBox_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% title_DirectoryString %%================================ enc_title_DirectoryString(Val) -> enc_title_DirectoryString(Val, []). enc_title_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_title_DirectoryString(Tlv) -> dec_title_DirectoryString(Tlv, []). dec_title_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 64 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 64 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 64 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 64 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% caseExactMatch_DirectoryString %%================================ enc_caseExactMatch_DirectoryString(Val) -> enc_caseExactMatch_DirectoryString(Val, []). enc_caseExactMatch_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_caseExactMatch_DirectoryString(Tlv) -> dec_caseExactMatch_DirectoryString(Tlv, []). dec_caseExactMatch_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% caseIgnoreMatch_DirectoryString %%================================ enc_caseIgnoreMatch_DirectoryString(Val) -> enc_caseIgnoreMatch_DirectoryString(Val, []). enc_caseIgnoreMatch_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_caseIgnoreMatch_DirectoryString(Tlv) -> dec_caseIgnoreMatch_DirectoryString(Tlv, []). dec_caseIgnoreMatch_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% dmdName_DirectoryString %%================================ enc_dmdName_DirectoryString(Val) -> enc_dmdName_DirectoryString(Val, []). enc_dmdName_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_dmdName_DirectoryString(Tlv) -> dec_dmdName_DirectoryString(Tlv, []). dec_dmdName_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 64 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 64 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 64 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 64 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% surname_DirectoryString %%================================ enc_surname_DirectoryString(Val) -> enc_surname_DirectoryString(Val, []). enc_surname_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_surname_DirectoryString(Tlv) -> dec_surname_DirectoryString(Tlv, []). dec_surname_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 64 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 64 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 64 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 64 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% name_DirectoryString %%================================ enc_name_DirectoryString(Val) -> enc_name_DirectoryString(Val, []). enc_name_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_name_DirectoryString(Tlv) -> dec_name_DirectoryString(Tlv, []). dec_name_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% keywordMatch_DirectoryString %%================================ enc_keywordMatch_DirectoryString(Val) -> enc_keywordMatch_DirectoryString(Val, []). enc_keywordMatch_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_keywordMatch_DirectoryString(Tlv) -> dec_keywordMatch_DirectoryString(Tlv, []). dec_keywordMatch_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% stateOrProvinceName_DirectoryString %%================================ enc_stateOrProvinceName_DirectoryString(Val) -> enc_stateOrProvinceName_DirectoryString(Val, []). enc_stateOrProvinceName_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_stateOrProvinceName_DirectoryString(Tlv) -> dec_stateOrProvinceName_DirectoryString(Tlv, []). dec_stateOrProvinceName_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% knowledgeInformation_DirectoryString %%================================ enc_knowledgeInformation_DirectoryString(Val) -> enc_knowledgeInformation_DirectoryString(Val, []). enc_knowledgeInformation_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_knowledgeInformation_DirectoryString(Tlv) -> dec_knowledgeInformation_DirectoryString(Tlv, []). dec_knowledgeInformation_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% directoryStringFirstComponentMatch_DirectoryString %%================================ enc_directoryStringFirstComponentMatch_DirectoryString(Val) -> enc_directoryStringFirstComponentMatch_DirectoryString(Val, []). enc_directoryStringFirstComponentMatch_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_directoryStringFirstComponentMatch_DirectoryString(Tlv) -> dec_directoryStringFirstComponentMatch_DirectoryString(Tlv, []). dec_directoryStringFirstComponentMatch_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 32768 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 32768 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 32768 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 32768 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . %%================================ %% houseIdentifier_DirectoryString %%================================ enc_houseIdentifier_DirectoryString(Val) -> enc_houseIdentifier_DirectoryString(Val, []). enc_houseIdentifier_DirectoryString(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of teletexString -> encode_restricted_string(element(2,Val), [<<20>>]); printableString -> encode_restricted_string(element(2,Val), [<<19>>]); universalString -> encode_universal_string(element(2,Val), [<<28>>]); bmpString -> encode_BMP_string(element(2,Val), [<<30>>]); uTF8String -> encode_UTF8_string(element(2,Val), [<<12>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end, encode_tags(TagIn, EncBytes, EncLen). dec_houseIdentifier_DirectoryString(Tlv) -> dec_houseIdentifier_DirectoryString(Tlv, []). dec_houseIdentifier_DirectoryString(Tlv, TagIn) -> Tlv1 = match_tags(Tlv, TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of %% 'teletexString' {20, V1} -> {teletexString, begin Val1 = decode_restricted_string(V1, []), C1 = byte_size(Val1), if 1 =< C1, C1 =< 128 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end}; %% 'printableString' {19, V1} -> {printableString, begin Val2 = decode_restricted_string(V1, []), C2 = byte_size(Val2), if 1 =< C2, C2 =< 128 -> binary_to_list(Val2); true -> exit({error,{asn1,bad_range}}) end end}; %% 'universalString' {28, V1} -> {universalString, begin Val3 = decode_universal_string(V1, []), C3 = length(Val3), if 1 =< C3, C3 =< 128 -> Val3; true -> exit({error,{asn1,bad_range}}) end end}; %% 'bmpString' {30, V1} -> {bmpString, begin Val4 = decode_BMP_string(V1, []), C4 = length(Val4), if 1 =< C4, C4 =< 128 -> Val4; true -> exit({error,{asn1,bad_range}}) end end}; %% 'uTF8String' {12, V1} -> {uTF8String, decode_UTF8_string(V1, [])}; Else -> exit({error,{asn1,{invalid_choice_tag,Else}}}) end . 'id-at-encryptedAliasedEntryName'() -> {2,5,4,1,2}. 'id-at-knowledgeInformation'() -> {2,5,4,2}. 'id-at-commonName'() -> {2,5,4,3}. 'id-at-encryptedCommonName'() -> {2,5,4,3,2}. 'id-at-surname'() -> {2,5,4,4}. 'id-at-encryptedSurname'() -> {2,5,4,4,2}. 'id-at-serialNumber'() -> {2,5,4,5}. 'id-at-encryptedSerialNumber'() -> {2,5,4,5,2}. 'id-at-countryName'() -> {2,5,4,6}. 'id-at-encryptedCountryName'() -> {2,5,4,6,2}. 'id-at-localityName'() -> {2,5,4,7}. 'id-at-encryptedLocalityName'() -> {2,5,4,7,2}. 'id-at-collectiveLocalityName'() -> {2,5,4,7,1}. 'id-at-encryptedCollectiveLocalityName'() -> {2,5,4,7,1,2}. 'id-at-stateOrProvinceName'() -> {2,5,4,8}. 'id-at-encryptedStateOrProvinceName'() -> {2,5,4,8,2}. 'id-at-collectiveStateOrProvinceName'() -> {2,5,4,8,1}. 'id-at-encryptedCollectiveStateOrProvinceName'() -> {2,5,4,8,1,2}. 'id-at-streetAddress'() -> {2,5,4,9}. 'id-at-encryptedStreetAddress'() -> {2,5,4,9,2}. 'id-at-collectiveStreetAddress'() -> {2,5,4,9,1}. 'id-at-encryptedCollectiveStreetAddress'() -> {2,5,4,9,1,2}. 'id-at-organizationName'() -> {2,5,4,10}. 'id-at-encryptedOrganizationName'() -> {2,5,4,10,2}. 'id-at-collectiveOrganizationName'() -> {2,5,4,10,1}. 'id-at-encryptedCollectiveOrganizationName'() -> {2,5,4,10,1,2}. 'id-at-organizationalUnitName'() -> {2,5,4,11}. 'id-at-encryptedOrganizationalUnitName'() -> {2,5,4,11,2}. 'id-at-collectiveOrganizationalUnitName'() -> {2,5,4,11,1}. 'id-at-encryptedCollectiveOrganizationalUnitName'() -> {2,5,4,11,1,2}. 'id-at-title'() -> {2,5,4,12}. 'id-at-encryptedTitle'() -> {2,5,4,12,2}. 'id-at-description'() -> {2,5,4,13}. 'id-at-encryptedDescription'() -> {2,5,4,13,2}. 'id-at-searchGuide'() -> {2,5,4,14}. 'id-at-encryptedSearchGuide'() -> {2,5,4,14,2}. 'id-at-businessCategory'() -> {2,5,4,15}. 'id-at-encryptedBusinessCategory'() -> {2,5,4,15,2}. 'id-at-postalAddress'() -> {2,5,4,16}. 'id-at-encryptedPostalAddress'() -> {2,5,4,16,2}. 'id-at-collectivePostalAddress'() -> {2,5,4,16,1}. 'id-at-encryptedCollectivePostalAddress'() -> {2,5,4,16,1,2}. 'id-at-postalCode'() -> {2,5,4,17}. 'id-at-encryptedPostalCode'() -> {2,5,4,17,2}. 'id-at-collectivePostalCode'() -> {2,5,4,17,1}. 'id-at-encryptedCollectivePostalCode'() -> {2,5,4,17,1,2}. 'id-at-postOfficeBox'() -> {2,5,4,18}. 'id-at-encryptedPostOfficeBox'() -> {2,5,4,18,2}. 'id-at-collectivePostOfficeBox'() -> {2,5,4,18,1}. 'id-at-encryptedCollectivePostOfficeBox'() -> {2,5,4,18,1,2}. 'id-at-physicalDeliveryOfficeName'() -> {2,5,4,19}. 'id-at-encryptedPhysicalDeliveryOfficeName'() -> {2,5,4,19,2}. 'id-at-collectivePhysicalDeliveryOfficeName'() -> {2,5,4,19,1}. 'id-at-encryptedCollectivePhysicalDeliveryOfficeName'() -> {2,5,4,19,1,2}. 'id-at-telephoneNumber'() -> {2,5,4,20}. 'id-at-encryptedTelephoneNumber'() -> {2,5,4,20,2}. 'id-at-collectiveTelephoneNumber'() -> {2,5,4,20,1}. 'id-at-encryptedCollectiveTelephoneNumber'() -> {2,5,4,20,1,2}. 'id-at-telexNumber'() -> {2,5,4,21}. 'id-at-encryptedTelexNumber'() -> {2,5,4,21,2}. 'id-at-collectiveTelexNumber'() -> {2,5,4,21,1}. 'id-at-encryptedCollectiveTelexNumber'() -> {2,5,4,21,1,2}. 'id-at-facsimileTelephoneNumber'() -> {2,5,4,23}. 'id-at-encryptedFacsimileTelephoneNumber'() -> {2,5,4,23,2}. 'id-at-collectiveFacsimileTelephoneNumber'() -> {2,5,4,23,1}. 'id-at-encryptedCollectiveFacsimileTelephoneNumber'() -> {2,5,4,23,1,2}. 'id-at-x121Address'() -> {2,5,4,24}. 'id-at-encryptedX121Address'() -> {2,5,4,24,2}. 'id-at-internationalISDNNumber'() -> {2,5,4,25}. 'id-at-encryptedInternationalISDNNumber'() -> {2,5,4,25,2}. 'id-at-collectiveInternationalISDNNumber'() -> {2,5,4,25,1}. 'id-at-encryptedCollectiveInternationalISDNNumber'() -> {2,5,4,25,1,2}. 'id-at-registeredAddress'() -> {2,5,4,26}. 'id-at-encryptedRegisteredAddress'() -> {2,5,4,26,2}. 'id-at-destinationIndicator'() -> {2,5,4,27}. 'id-at-encryptedDestinationIndicator'() -> {2,5,4,27,2}. 'id-at-preferredDeliveryMethod'() -> {2,5,4,28}. 'id-at-encryptedPreferredDeliveryMethod'() -> {2,5,4,28,2}. 'id-at-presentationAddress'() -> {2,5,4,29}. 'id-at-encryptedPresentationAddress'() -> {2,5,4,29,2}. 'id-at-supportedApplicationContext'() -> {2,5,4,30}. 'id-at-encryptedSupportedApplicationContext'() -> {2,5,4,30,2}. 'id-at-member'() -> {2,5,4,31}. 'id-at-encryptedMember'() -> {2,5,4,31,2}. 'id-at-owner'() -> {2,5,4,32}. 'id-at-encryptedOwner'() -> {2,5,4,32,2}. 'id-at-roleOccupant'() -> {2,5,4,33}. 'id-at-encryptedRoleOccupant'() -> {2,5,4,33,2}. 'id-at-seeAlso'() -> {2,5,4,34}. 'id-at-encryptedSeeAlso'() -> {2,5,4,34,2}. 'id-at-encryptedUserPassword'() -> {2,5,4,35,2}. 'id-at-encryptedUserCertificate'() -> {2,5,4,36,2}. 'id-at-encryptedCACertificate'() -> {2,5,4,37,2}. 'id-at-encryptedAuthorityRevocationList'() -> {2,5,4,38,2}. 'id-at-encryptedCertificateRevocationList'() -> {2,5,4,39,2}. 'id-at-encryptedCrossCertificatePair'() -> {2,5,4,40,2}. 'id-at-name'() -> {2,5,4,41}. 'id-at-givenName'() -> {2,5,4,42}. 'id-at-encryptedGivenName'() -> {2,5,4,42,2}. 'id-at-initials'() -> {2,5,4,43}. 'id-at-encryptedInitials'() -> {2,5,4,43,2}. 'id-at-generationQualifier'() -> {2,5,4,44}. 'id-at-encryptedGenerationQualifier'() -> {2,5,4,44,2}. 'id-at-uniqueIdentifier'() -> {2,5,4,45}. 'id-at-encryptedUniqueIdentifier'() -> {2,5,4,45,2}. 'id-at-dnQualifier'() -> {2,5,4,46}. 'id-at-encryptedDnQualifier'() -> {2,5,4,46,2}. 'id-at-enhancedSearchGuide'() -> {2,5,4,47}. 'id-at-encryptedEnhancedSearchGuide'() -> {2,5,4,47,2}. 'id-at-protocolInformation'() -> {2,5,4,48}. 'id-at-encryptedProtocolInformation'() -> {2,5,4,48,2}. 'id-at-distinguishedName'() -> {2,5,4,49}. 'id-at-encryptedDistinguishedName'() -> {2,5,4,49,2}. 'id-at-uniqueMember'() -> {2,5,4,50}. 'id-at-encryptedUniqueMember'() -> {2,5,4,50,2}. 'id-at-houseIdentifier'() -> {2,5,4,51}. 'id-at-encryptedHouseIdentifier'() -> {2,5,4,51,2}. 'id-at-encryptedSupportedAlgorithms'() -> {2,5,4,52,2}. 'id-at-encryptedDeltaRevocationList'() -> {2,5,4,53,2}. 'id-at-dmdName'() -> {2,5,4,54}. 'id-at-encryptedDmdName'() -> {2,5,4,54,2}. 'id-at-encryptedClearance'() -> {2,5,4,55,2}. 'id-at-encryptedDefaultDirQop'() -> {2,5,4,56,2}. 'id-at-encryptedAttributeIntegrityInfo'() -> {2,5,4,57,2}. 'id-at-encryptedAttributeCertificate'() -> {2,5,4,58,2}. 'id-at-encryptedAttributeCertificateRevocationList'() -> {2,5,4,59,2}. 'id-at-encryptedConfKeyInfo'() -> {2,5,4,60,2}. 'id-at-pseudonym'() -> {2,5,4,65}. 'id-at-communicationsService'() -> {2,5,4,66}. 'id-at-communicationsNetwork'() -> {2,5,4,67}. 'id-mr-caseIgnoreMatch'() -> {2,5,13,2}. 'id-mr-caseIgnoreOrderingMatch'() -> {2,5,13,3}. 'id-mr-caseIgnoreSubstringsMatch'() -> {2,5,13,4}. 'id-mr-caseExactMatch'() -> {2,5,13,5}. 'id-mr-caseExactOrderingMatch'() -> {2,5,13,6}. 'id-mr-caseExactSubstringsMatch'() -> {2,5,13,7}. 'id-mr-numericStringMatch'() -> {2,5,13,8}. 'id-mr-numericStringOrderingMatch'() -> {2,5,13,9}. 'id-mr-numericStringSubstringsMatch'() -> {2,5,13,10}. 'id-mr-caseIgnoreListMatch'() -> {2,5,13,11}. 'id-mr-caseIgnoreListSubstringsMatch'() -> {2,5,13,12}. 'id-mr-booleanMatch'() -> {2,5,13,13}. 'id-mr-integerMatch'() -> {2,5,13,14}. 'id-mr-integerOrderingMatch'() -> {2,5,13,15}. 'id-mr-bitStringMatch'() -> {2,5,13,16}. 'id-mr-octetStringMatch'() -> {2,5,13,17}. 'id-mr-octetStringOrderingMatch'() -> {2,5,13,18}. 'id-mr-octetStringSubstringsMatch'() -> {2,5,13,19}. 'id-mr-telephoneNumberMatch'() -> {2,5,13,20}. 'id-mr-telephoneNumberSubstringsMatch'() -> {2,5,13,21}. 'id-mr-presentationAddressMatch'() -> {2,5,13,22}. 'id-mr-uniqueMemberMatch'() -> {2,5,13,23}. 'id-mr-protocolInformationMatch'() -> {2,5,13,24}. 'id-mr-uTCTimeMatch'() -> {2,5,13,25}. 'id-mr-uTCTimeOrderingMatch'() -> {2,5,13,26}. 'id-mr-generalizedTimeMatch'() -> {2,5,13,27}. 'id-mr-generalizedTimeOrderingMatch'() -> {2,5,13,28}. 'id-mr-integerFirstComponentMatch'() -> {2,5,13,29}. 'id-mr-objectIdentifierFirstComponentMatch'() -> {2,5,13,30}. 'id-mr-directoryStringFirstComponentMatch'() -> {2,5,13,31}. 'id-mr-wordMatch'() -> {2,5,13,32}. 'id-mr-keywordMatch'() -> {2,5,13,33}. 'id-mr-storedPrefixMatch'() -> {2,5,13,41}. 'id-mr-systemProposedMatch'() -> {2,5,13,47}. 'id-mr-generalWordMatch'() -> {2,5,13,48}. 'id-mr-approximateStringMatch'() -> {2,5,13,49}. 'id-mr-ignoreIfAbsentMatch'() -> {2,5,13,50}. 'id-mr-nullMatch'() -> {2,5,13,51}. 'id-mr-zonalMatch'() -> {2,5,13,52}. 'id-mr-facsimileNumberMatch'() -> {2,5,13,63}. 'id-mr-facsimileNumberSubstringsMatch'() -> {2,5,13,64}. 'id-avc-language'() -> {2,5,31,0}. 'id-avc-temporal'() -> {2,5,31,1}. 'id-avc-locale'() -> {2,5,31,2}. 'id-pr-targetDsaUnavailable'() -> {2,5,34,1}. 'id-pr-dataSourceUnavailable'() -> {2,5,34,2}. 'id-pr-unidentifiedOperation'() -> {2,5,34,3}. 'id-pr-unavailableOperation'() -> {2,5,34,4}. 'id-pr-searchAttributeViolation'() -> {2,5,34,5}. 'id-pr-searchAttributeCombinationViolation'() -> {2,5,34,6}. 'id-pr-searchValueNotAllowed'() -> {2,5,34,7}. 'id-pr-missingSearchAttribute'() -> {2,5,34,8}. 'id-pr-searchValueViolation'() -> {2,5,34,9}. 'id-pr-attributeNegationViolation'() -> {2,5,34,10}. 'id-pr-searchValueRequired'() -> {2,5,34,11}. 'id-pr-invalidSearchValue'() -> {2,5,34,12}. 'id-pr-searchContextViolation'() -> {2,5,34,13}. 'id-pr-searchContextCombinationViolation'() -> {2,5,34,14}. 'id-pr-missingSearchContext'() -> {2,5,34,15}. 'id-pr-searchContextValueViolation'() -> {2,5,34,16}. 'id-pr-searchContextValueRequired'() -> {2,5,34,17}. 'id-pr-invalidContextSearchValue'() -> {2,5,34,18}. 'id-pr-unsupportedMatchingRule'() -> {2,5,34,19}. 'id-pr-attributeMatchingViolation'() -> {2,5,34,20}. 'id-pr-unsupportedMatchingUse'() -> {2,5,34,21}. 'id-pr-matchingUseViolation'() -> {2,5,34,22}. 'id-pr-hierarchySelectForbidden'() -> {2,5,34,23}. 'id-pr-invalidHierarchySelect'() -> {2,5,34,24}. 'id-pr-unavailableHierarchySelect'() -> {2,5,34,25}. 'id-pr-invalidSearchOptions'() -> {2,5,34,26}. 'id-pr-missingSearchOptions'() -> {2,5,34,27}. 'id-pr-invalidServiceControlOptions'() -> {2,5,34,28}. 'id-pr-missingServiceControlOptions'() -> {2,5,34,29}. 'id-pr-searchSubsetViolation'() -> {2,5,34,30}. 'id-pr-unmatchedKeyAttributes'() -> {2,5,34,31}. 'id-pr-ambiguousKeyAttributes'() -> {2,5,34,32}. 'id-not-dSAProblem'() -> {2,5,35,0}. 'id-not-searchServiceProblem'() -> {2,5,35,1}. 'id-not-serviceType'() -> {2,5,35,2}. 'id-not-attributeTypeList'() -> {2,5,35,3}. 'id-not-matchingRuleList'() -> {2,5,35,4}. 'id-not-filterItem'() -> {2,5,35,5}. 'id-not-attributeCombinations'() -> {2,5,35,6}. 'id-not-contextTypeList'() -> {2,5,35,7}. 'id-not-contextList'() -> {2,5,35,8}. 'id-not-contextCombinations'() -> {2,5,35,9}. 'id-not-hierarchySelectList'() -> {2,5,35,10}. 'id-not-searchOptionsList'() -> {2,5,35,11}. 'id-not-serviceControlOptionsList'() -> {2,5,35,12}. 'id-not-multipleMatchingLocalities'() -> {2,5,35,13}. 'id-not-proposedRelaxation'() -> {2,5,35,14}. 'id-not-appliedRelaxation'() -> {2,5,35,15}. 'id-not-substringRequirements'() -> {2,5,35,16}. 'id-cat-sequenceMatchType'() -> {2,5,37,1}. 'id-cat-wordMatchType'() -> {2,5,37,2}. 'id-cat-characterMatchTypes'() -> {2,5,37,3}. 'id-cat-selectedContexts'() -> {2,5,37,4}. %%================================ %% knowledgeInformation %%================================ enc_knowledgeInformation(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_knowledgeInformation('Type', Val, _RestPrimFieldName) -> enc_knowledgeInformation_DirectoryString(Val,[]); enc_knowledgeInformation('equality-match', Val, [H|T]) -> enc_caseIgnoreMatch(H, Val, T); enc_knowledgeInformation('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_knowledgeInformation('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_knowledgeInformation(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_knowledgeInformation('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_knowledgeInformation_DirectoryString(Tlv,[]); dec_knowledgeInformation('equality-match', Bytes,[H|T]) -> dec_caseIgnoreMatch(H, Bytes, T); dec_knowledgeInformation('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_knowledgeInformation('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). tlv_format(Bytes) when is_binary(Bytes) -> {Tlv,_} = ber_decode_nif(Bytes), Tlv; tlv_format(Bytes) -> Bytes. %%================================ %% name %%================================ enc_name(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_name('Type', Val, _RestPrimFieldName) -> enc_name_DirectoryString(Val,[]); enc_name('equality-match', Val, [H|T]) -> enc_caseIgnoreMatch(H, Val, T); enc_name('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_name('substrings-match', Val, [H|T]) -> enc_caseIgnoreSubstringsMatch(H, Val, T). dec_name(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_name('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_name_DirectoryString(Tlv,[]); dec_name('equality-match', Bytes,[H|T]) -> dec_caseIgnoreMatch(H, Bytes, T); dec_name('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_name('substrings-match', Bytes,[H|T]) -> dec_caseIgnoreSubstringsMatch(H, Bytes, T). %%================================ %% commonName %%================================ enc_commonName(derivation, Val, [H|T]) -> enc_name(H, Val, T); enc_commonName('Type', Val, _RestPrimFieldName) -> enc_commonName_DirectoryString(Val,[]); enc_commonName('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_commonName('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_commonName('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_commonName(derivation, Bytes,[H|T]) -> dec_name(H, Bytes, T); dec_commonName('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_commonName_DirectoryString(Tlv,[]); dec_commonName('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_commonName('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_commonName('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% surname %%================================ enc_surname(derivation, Val, [H|T]) -> enc_name(H, Val, T); enc_surname('Type', Val, _RestPrimFieldName) -> enc_surname_DirectoryString(Val,[]); enc_surname('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_surname('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_surname('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_surname(derivation, Bytes,[H|T]) -> dec_name(H, Bytes, T); dec_surname('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_surname_DirectoryString(Tlv,[]); dec_surname('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_surname('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_surname('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% givenName %%================================ enc_givenName(derivation, Val, [H|T]) -> enc_name(H, Val, T); enc_givenName('Type', Val, _RestPrimFieldName) -> enc_givenName_DirectoryString(Val,[]); enc_givenName('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_givenName('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_givenName('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_givenName(derivation, Bytes,[H|T]) -> dec_name(H, Bytes, T); dec_givenName('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_givenName_DirectoryString(Tlv,[]); dec_givenName('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_givenName('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_givenName('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% initials %%================================ enc_initials(derivation, Val, [H|T]) -> enc_name(H, Val, T); enc_initials('Type', Val, _RestPrimFieldName) -> enc_initials_DirectoryString(Val,[]); enc_initials('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_initials('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_initials('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_initials(derivation, Bytes,[H|T]) -> dec_name(H, Bytes, T); dec_initials('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_initials_DirectoryString(Tlv,[]); dec_initials('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_initials('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_initials('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% generationQualifier %%================================ enc_generationQualifier(derivation, Val, [H|T]) -> enc_name(H, Val, T); enc_generationQualifier('Type', Val, _RestPrimFieldName) -> enc_generationQualifier_DirectoryString(Val,[]); enc_generationQualifier('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_generationQualifier('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_generationQualifier('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_generationQualifier(derivation, Bytes,[H|T]) -> dec_name(H, Bytes, T); dec_generationQualifier('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_generationQualifier_DirectoryString(Tlv,[]); dec_generationQualifier('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_generationQualifier('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_generationQualifier('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% uniqueIdentifier %%================================ enc_uniqueIdentifier(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_uniqueIdentifier('Type', Val, _RestPrimFieldName) -> enc_UniqueIdentifier(Val, [<<3>>]); enc_uniqueIdentifier('equality-match', Val, [H|T]) -> enc_bitStringMatch(H, Val, T); enc_uniqueIdentifier('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_uniqueIdentifier('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_uniqueIdentifier(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_uniqueIdentifier('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_UniqueIdentifier(Tlv, [3]); dec_uniqueIdentifier('equality-match', Bytes,[H|T]) -> dec_bitStringMatch(H, Bytes, T); dec_uniqueIdentifier('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_uniqueIdentifier('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% dnQualifier %%================================ enc_dnQualifier(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_dnQualifier('Type', Val, _RestPrimFieldName) -> encode_restricted_string(Val, [<<19>>]); enc_dnQualifier('equality-match', Val, [H|T]) -> enc_caseIgnoreMatch(H, Val, T); enc_dnQualifier('ordering-match', Val, [H|T]) -> enc_caseIgnoreOrderingMatch(H, Val, T); enc_dnQualifier('substrings-match', Val, [H|T]) -> enc_caseIgnoreSubstringsMatch(H, Val, T). dec_dnQualifier(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_dnQualifier('Type', Bytes,_) -> Tlv = tlv_format(Bytes), begin binary_to_list(decode_restricted_string(Tlv, [19])) end ; dec_dnQualifier('equality-match', Bytes,[H|T]) -> dec_caseIgnoreMatch(H, Bytes, T); dec_dnQualifier('ordering-match', Bytes,[H|T]) -> dec_caseIgnoreOrderingMatch(H, Bytes, T); dec_dnQualifier('substrings-match', Bytes,[H|T]) -> dec_caseIgnoreSubstringsMatch(H, Bytes, T). %%================================ %% serialNumber %%================================ enc_serialNumber(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_serialNumber('Type', Val, _RestPrimFieldName) -> encode_restricted_string(Val, [<<19>>]); enc_serialNumber('equality-match', Val, [H|T]) -> enc_caseIgnoreMatch(H, Val, T); enc_serialNumber('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_serialNumber('substrings-match', Val, [H|T]) -> enc_caseIgnoreSubstringsMatch(H, Val, T). dec_serialNumber(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_serialNumber('Type', Bytes,_) -> Tlv = tlv_format(Bytes), begin Val1 = decode_restricted_string(Tlv, [19]), C1 = byte_size(Val1), if 1 =< C1, C1 =< 64 -> binary_to_list(Val1); true -> exit({error,{asn1,bad_range}}) end end; dec_serialNumber('equality-match', Bytes,[H|T]) -> dec_caseIgnoreMatch(H, Bytes, T); dec_serialNumber('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_serialNumber('substrings-match', Bytes,[H|T]) -> dec_caseIgnoreSubstringsMatch(H, Bytes, T). %%================================ %% pseudonym %%================================ enc_pseudonym(derivation, Val, [H|T]) -> enc_name(H, Val, T); enc_pseudonym('Type', Val, _RestPrimFieldName) -> enc_pseudonym_DirectoryString(Val,[]); enc_pseudonym('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_pseudonym('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_pseudonym('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_pseudonym(derivation, Bytes,[H|T]) -> dec_name(H, Bytes, T); dec_pseudonym('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_pseudonym_DirectoryString(Tlv,[]); dec_pseudonym('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_pseudonym('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_pseudonym('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% countryName %%================================ enc_countryName(derivation, Val, [H|T]) -> enc_name(H, Val, T); enc_countryName('Type', Val, _RestPrimFieldName) -> enc_CountryName(Val, [<<19>>]); enc_countryName('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_countryName('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_countryName('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_countryName(derivation, Bytes,[H|T]) -> dec_name(H, Bytes, T); dec_countryName('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_CountryName(Tlv, [19]); dec_countryName('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_countryName('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_countryName('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% localityName %%================================ enc_localityName(derivation, Val, [H|T]) -> enc_name(H, Val, T); enc_localityName('Type', Val, _RestPrimFieldName) -> enc_localityName_DirectoryString(Val,[]); enc_localityName('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_localityName('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_localityName('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_localityName(derivation, Bytes,[H|T]) -> dec_name(H, Bytes, T); dec_localityName('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_localityName_DirectoryString(Tlv,[]); dec_localityName('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_localityName('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_localityName('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% collectiveLocalityName %%================================ enc_collectiveLocalityName(derivation, Val, [H|T]) -> enc_localityName(H, Val, T); enc_collectiveLocalityName('Type', Val, _RestPrimFieldName) -> {Val,0}; enc_collectiveLocalityName('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_collectiveLocalityName('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_collectiveLocalityName('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_collectiveLocalityName(derivation, Bytes,[H|T]) -> dec_localityName(H, Bytes, T); dec_collectiveLocalityName('Type', Bytes,_) -> Bytes; dec_collectiveLocalityName('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_collectiveLocalityName('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_collectiveLocalityName('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% stateOrProvinceName %%================================ enc_stateOrProvinceName(derivation, Val, [H|T]) -> enc_name(H, Val, T); enc_stateOrProvinceName('Type', Val, _RestPrimFieldName) -> enc_stateOrProvinceName_DirectoryString(Val,[]); enc_stateOrProvinceName('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_stateOrProvinceName('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_stateOrProvinceName('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_stateOrProvinceName(derivation, Bytes,[H|T]) -> dec_name(H, Bytes, T); dec_stateOrProvinceName('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_stateOrProvinceName_DirectoryString(Tlv,[]); dec_stateOrProvinceName('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_stateOrProvinceName('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_stateOrProvinceName('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% collectiveStateOrProvinceName %%================================ enc_collectiveStateOrProvinceName(derivation, Val, [H|T]) -> enc_stateOrProvinceName(H, Val, T); enc_collectiveStateOrProvinceName('Type', Val, _RestPrimFieldName) -> {Val,0}; enc_collectiveStateOrProvinceName('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_collectiveStateOrProvinceName('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_collectiveStateOrProvinceName('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_collectiveStateOrProvinceName(derivation, Bytes,[H|T]) -> dec_stateOrProvinceName(H, Bytes, T); dec_collectiveStateOrProvinceName('Type', Bytes,_) -> Bytes; dec_collectiveStateOrProvinceName('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_collectiveStateOrProvinceName('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_collectiveStateOrProvinceName('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% streetAddress %%================================ enc_streetAddress(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_streetAddress('Type', Val, _RestPrimFieldName) -> enc_streetAddress_DirectoryString(Val,[]); enc_streetAddress('equality-match', Val, [H|T]) -> enc_caseIgnoreMatch(H, Val, T); enc_streetAddress('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_streetAddress('substrings-match', Val, [H|T]) -> enc_caseIgnoreSubstringsMatch(H, Val, T). dec_streetAddress(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_streetAddress('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_streetAddress_DirectoryString(Tlv,[]); dec_streetAddress('equality-match', Bytes,[H|T]) -> dec_caseIgnoreMatch(H, Bytes, T); dec_streetAddress('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_streetAddress('substrings-match', Bytes,[H|T]) -> dec_caseIgnoreSubstringsMatch(H, Bytes, T). %%================================ %% collectiveStreetAddress %%================================ enc_collectiveStreetAddress(derivation, Val, [H|T]) -> enc_streetAddress(H, Val, T); enc_collectiveStreetAddress('Type', Val, _RestPrimFieldName) -> {Val,0}; enc_collectiveStreetAddress('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_collectiveStreetAddress('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_collectiveStreetAddress('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_collectiveStreetAddress(derivation, Bytes,[H|T]) -> dec_streetAddress(H, Bytes, T); dec_collectiveStreetAddress('Type', Bytes,_) -> Bytes; dec_collectiveStreetAddress('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_collectiveStreetAddress('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_collectiveStreetAddress('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% houseIdentifier %%================================ enc_houseIdentifier(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_houseIdentifier('Type', Val, _RestPrimFieldName) -> enc_houseIdentifier_DirectoryString(Val,[]); enc_houseIdentifier('equality-match', Val, [H|T]) -> enc_caseIgnoreMatch(H, Val, T); enc_houseIdentifier('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_houseIdentifier('substrings-match', Val, [H|T]) -> enc_caseIgnoreSubstringsMatch(H, Val, T). dec_houseIdentifier(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_houseIdentifier('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_houseIdentifier_DirectoryString(Tlv,[]); dec_houseIdentifier('equality-match', Bytes,[H|T]) -> dec_caseIgnoreMatch(H, Bytes, T); dec_houseIdentifier('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_houseIdentifier('substrings-match', Bytes,[H|T]) -> dec_caseIgnoreSubstringsMatch(H, Bytes, T). %%================================ %% organizationName %%================================ enc_organizationName(derivation, Val, [H|T]) -> enc_name(H, Val, T); enc_organizationName('Type', Val, _RestPrimFieldName) -> enc_organizationName_DirectoryString(Val,[]); enc_organizationName('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_organizationName('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_organizationName('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_organizationName(derivation, Bytes,[H|T]) -> dec_name(H, Bytes, T); dec_organizationName('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_organizationName_DirectoryString(Tlv,[]); dec_organizationName('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_organizationName('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_organizationName('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% collectiveOrganizationName %%================================ enc_collectiveOrganizationName(derivation, Val, [H|T]) -> enc_organizationName(H, Val, T); enc_collectiveOrganizationName('Type', Val, _RestPrimFieldName) -> {Val,0}; enc_collectiveOrganizationName('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_collectiveOrganizationName('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_collectiveOrganizationName('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_collectiveOrganizationName(derivation, Bytes,[H|T]) -> dec_organizationName(H, Bytes, T); dec_collectiveOrganizationName('Type', Bytes,_) -> Bytes; dec_collectiveOrganizationName('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_collectiveOrganizationName('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_collectiveOrganizationName('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% organizationalUnitName %%================================ enc_organizationalUnitName(derivation, Val, [H|T]) -> enc_name(H, Val, T); enc_organizationalUnitName('Type', Val, _RestPrimFieldName) -> enc_organizationalUnitName_DirectoryString(Val,[]); enc_organizationalUnitName('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_organizationalUnitName('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_organizationalUnitName('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_organizationalUnitName(derivation, Bytes,[H|T]) -> dec_name(H, Bytes, T); dec_organizationalUnitName('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_organizationalUnitName_DirectoryString(Tlv,[]); dec_organizationalUnitName('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_organizationalUnitName('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_organizationalUnitName('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% collectiveOrganizationalUnitName %%================================ enc_collectiveOrganizationalUnitName(derivation, Val, [H|T]) -> enc_organizationalUnitName(H, Val, T); enc_collectiveOrganizationalUnitName('Type', Val, _RestPrimFieldName) -> {Val,0}; enc_collectiveOrganizationalUnitName('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_collectiveOrganizationalUnitName('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_collectiveOrganizationalUnitName('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_collectiveOrganizationalUnitName(derivation, Bytes,[H|T]) -> dec_organizationalUnitName(H, Bytes, T); dec_collectiveOrganizationalUnitName('Type', Bytes,_) -> Bytes; dec_collectiveOrganizationalUnitName('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_collectiveOrganizationalUnitName('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_collectiveOrganizationalUnitName('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% title %%================================ enc_title(derivation, Val, [H|T]) -> enc_name(H, Val, T); enc_title('Type', Val, _RestPrimFieldName) -> enc_title_DirectoryString(Val,[]); enc_title('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_title('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_title('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_title(derivation, Bytes,[H|T]) -> dec_name(H, Bytes, T); dec_title('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_title_DirectoryString(Tlv,[]); dec_title('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_title('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_title('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% description %%================================ enc_description(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_description('Type', Val, _RestPrimFieldName) -> enc_description_DirectoryString(Val,[]); enc_description('equality-match', Val, [H|T]) -> enc_caseIgnoreMatch(H, Val, T); enc_description('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_description('substrings-match', Val, [H|T]) -> enc_caseIgnoreSubstringsMatch(H, Val, T). dec_description(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_description('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_description_DirectoryString(Tlv,[]); dec_description('equality-match', Bytes,[H|T]) -> dec_caseIgnoreMatch(H, Bytes, T); dec_description('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_description('substrings-match', Bytes,[H|T]) -> dec_caseIgnoreSubstringsMatch(H, Bytes, T). %%================================ %% searchGuide %%================================ enc_searchGuide(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_searchGuide('Type', Val, _RestPrimFieldName) -> enc_Guide(Val, [<<49>>]); enc_searchGuide('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_searchGuide('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_searchGuide('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_searchGuide(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_searchGuide('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_Guide(Tlv, [17]); dec_searchGuide('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_searchGuide('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_searchGuide('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% enhancedSearchGuide %%================================ enc_enhancedSearchGuide(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_enhancedSearchGuide('Type', Val, _RestPrimFieldName) -> enc_EnhancedGuide(Val, [<<48>>]); enc_enhancedSearchGuide('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_enhancedSearchGuide('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_enhancedSearchGuide('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_enhancedSearchGuide(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_enhancedSearchGuide('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_EnhancedGuide(Tlv, [16]); dec_enhancedSearchGuide('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_enhancedSearchGuide('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_enhancedSearchGuide('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% businessCategory %%================================ enc_businessCategory(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_businessCategory('Type', Val, _RestPrimFieldName) -> enc_businessCategory_DirectoryString(Val,[]); enc_businessCategory('equality-match', Val, [H|T]) -> enc_caseIgnoreMatch(H, Val, T); enc_businessCategory('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_businessCategory('substrings-match', Val, [H|T]) -> enc_caseIgnoreSubstringsMatch(H, Val, T). dec_businessCategory(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_businessCategory('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_businessCategory_DirectoryString(Tlv,[]); dec_businessCategory('equality-match', Bytes,[H|T]) -> dec_caseIgnoreMatch(H, Bytes, T); dec_businessCategory('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_businessCategory('substrings-match', Bytes,[H|T]) -> dec_caseIgnoreSubstringsMatch(H, Bytes, T). %%================================ %% postalAddress %%================================ enc_postalAddress(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_postalAddress('Type', Val, _RestPrimFieldName) -> enc_PostalAddress(Val, [<<48>>]); enc_postalAddress('equality-match', Val, [H|T]) -> enc_caseIgnoreListMatch(H, Val, T); enc_postalAddress('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_postalAddress('substrings-match', Val, [H|T]) -> enc_caseIgnoreListSubstringsMatch(H, Val, T). dec_postalAddress(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_postalAddress('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_PostalAddress(Tlv, [16]); dec_postalAddress('equality-match', Bytes,[H|T]) -> dec_caseIgnoreListMatch(H, Bytes, T); dec_postalAddress('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_postalAddress('substrings-match', Bytes,[H|T]) -> dec_caseIgnoreListSubstringsMatch(H, Bytes, T). %%================================ %% collectivePostalAddress %%================================ enc_collectivePostalAddress(derivation, Val, [H|T]) -> enc_postalAddress(H, Val, T); enc_collectivePostalAddress('Type', Val, _RestPrimFieldName) -> {Val,0}; enc_collectivePostalAddress('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_collectivePostalAddress('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_collectivePostalAddress('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_collectivePostalAddress(derivation, Bytes,[H|T]) -> dec_postalAddress(H, Bytes, T); dec_collectivePostalAddress('Type', Bytes,_) -> Bytes; dec_collectivePostalAddress('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_collectivePostalAddress('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_collectivePostalAddress('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% postalCode %%================================ enc_postalCode(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_postalCode('Type', Val, _RestPrimFieldName) -> enc_postalCode_DirectoryString(Val,[]); enc_postalCode('equality-match', Val, [H|T]) -> enc_caseIgnoreMatch(H, Val, T); enc_postalCode('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_postalCode('substrings-match', Val, [H|T]) -> enc_caseIgnoreSubstringsMatch(H, Val, T). dec_postalCode(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_postalCode('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_postalCode_DirectoryString(Tlv,[]); dec_postalCode('equality-match', Bytes,[H|T]) -> dec_caseIgnoreMatch(H, Bytes, T); dec_postalCode('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_postalCode('substrings-match', Bytes,[H|T]) -> dec_caseIgnoreSubstringsMatch(H, Bytes, T). %%================================ %% collectivePostalCode %%================================ enc_collectivePostalCode(derivation, Val, [H|T]) -> enc_postalCode(H, Val, T); enc_collectivePostalCode('Type', Val, _RestPrimFieldName) -> {Val,0}; enc_collectivePostalCode('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_collectivePostalCode('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_collectivePostalCode('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_collectivePostalCode(derivation, Bytes,[H|T]) -> dec_postalCode(H, Bytes, T); dec_collectivePostalCode('Type', Bytes,_) -> Bytes; dec_collectivePostalCode('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_collectivePostalCode('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_collectivePostalCode('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% postOfficeBox %%================================ enc_postOfficeBox(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_postOfficeBox('Type', Val, _RestPrimFieldName) -> enc_postOfficeBox_DirectoryString(Val,[]); enc_postOfficeBox('equality-match', Val, [H|T]) -> enc_caseIgnoreMatch(H, Val, T); enc_postOfficeBox('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_postOfficeBox('substrings-match', Val, [H|T]) -> enc_caseIgnoreSubstringsMatch(H, Val, T). dec_postOfficeBox(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_postOfficeBox('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_postOfficeBox_DirectoryString(Tlv,[]); dec_postOfficeBox('equality-match', Bytes,[H|T]) -> dec_caseIgnoreMatch(H, Bytes, T); dec_postOfficeBox('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_postOfficeBox('substrings-match', Bytes,[H|T]) -> dec_caseIgnoreSubstringsMatch(H, Bytes, T). %%================================ %% collectivePostOfficeBox %%================================ enc_collectivePostOfficeBox(derivation, Val, [H|T]) -> enc_postOfficeBox(H, Val, T); enc_collectivePostOfficeBox('Type', Val, _RestPrimFieldName) -> {Val,0}; enc_collectivePostOfficeBox('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_collectivePostOfficeBox('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_collectivePostOfficeBox('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_collectivePostOfficeBox(derivation, Bytes,[H|T]) -> dec_postOfficeBox(H, Bytes, T); dec_collectivePostOfficeBox('Type', Bytes,_) -> Bytes; dec_collectivePostOfficeBox('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_collectivePostOfficeBox('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_collectivePostOfficeBox('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% physicalDeliveryOfficeName %%================================ enc_physicalDeliveryOfficeName(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_physicalDeliveryOfficeName('Type', Val, _RestPrimFieldName) -> enc_physicalDeliveryOfficeName_DirectoryString(Val,[]); enc_physicalDeliveryOfficeName('equality-match', Val, [H|T]) -> enc_caseIgnoreMatch(H, Val, T); enc_physicalDeliveryOfficeName('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_physicalDeliveryOfficeName('substrings-match', Val, [H|T]) -> enc_caseIgnoreSubstringsMatch(H, Val, T). dec_physicalDeliveryOfficeName(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_physicalDeliveryOfficeName('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_physicalDeliveryOfficeName_DirectoryString(Tlv,[]); dec_physicalDeliveryOfficeName('equality-match', Bytes,[H|T]) -> dec_caseIgnoreMatch(H, Bytes, T); dec_physicalDeliveryOfficeName('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_physicalDeliveryOfficeName('substrings-match', Bytes,[H|T]) -> dec_caseIgnoreSubstringsMatch(H, Bytes, T). %%================================ %% collectivePhysicalDeliveryOfficeName %%================================ enc_collectivePhysicalDeliveryOfficeName(derivation, Val, [H|T]) -> enc_physicalDeliveryOfficeName(H, Val, T); enc_collectivePhysicalDeliveryOfficeName('Type', Val, _RestPrimFieldName) -> {Val,0}; enc_collectivePhysicalDeliveryOfficeName('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_collectivePhysicalDeliveryOfficeName('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_collectivePhysicalDeliveryOfficeName('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_collectivePhysicalDeliveryOfficeName(derivation, Bytes,[H|T]) -> dec_physicalDeliveryOfficeName(H, Bytes, T); dec_collectivePhysicalDeliveryOfficeName('Type', Bytes,_) -> Bytes; dec_collectivePhysicalDeliveryOfficeName('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_collectivePhysicalDeliveryOfficeName('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_collectivePhysicalDeliveryOfficeName('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% telephoneNumber %%================================ enc_telephoneNumber(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_telephoneNumber('Type', Val, _RestPrimFieldName) -> enc_TelephoneNumber(Val, [<<19>>]); enc_telephoneNumber('equality-match', Val, [H|T]) -> enc_telephoneNumberMatch(H, Val, T); enc_telephoneNumber('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_telephoneNumber('substrings-match', Val, [H|T]) -> enc_telephoneNumberSubstringsMatch(H, Val, T). dec_telephoneNumber(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_telephoneNumber('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_TelephoneNumber(Tlv, [19]); dec_telephoneNumber('equality-match', Bytes,[H|T]) -> dec_telephoneNumberMatch(H, Bytes, T); dec_telephoneNumber('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_telephoneNumber('substrings-match', Bytes,[H|T]) -> dec_telephoneNumberSubstringsMatch(H, Bytes, T). %%================================ %% collectiveTelephoneNumber %%================================ enc_collectiveTelephoneNumber(derivation, Val, [H|T]) -> enc_telephoneNumber(H, Val, T); enc_collectiveTelephoneNumber('Type', Val, _RestPrimFieldName) -> {Val,0}; enc_collectiveTelephoneNumber('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_collectiveTelephoneNumber('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_collectiveTelephoneNumber('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_collectiveTelephoneNumber(derivation, Bytes,[H|T]) -> dec_telephoneNumber(H, Bytes, T); dec_collectiveTelephoneNumber('Type', Bytes,_) -> Bytes; dec_collectiveTelephoneNumber('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_collectiveTelephoneNumber('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_collectiveTelephoneNumber('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% telexNumber %%================================ enc_telexNumber(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_telexNumber('Type', Val, _RestPrimFieldName) -> enc_TelexNumber(Val, [<<48>>]); enc_telexNumber('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_telexNumber('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_telexNumber('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_telexNumber(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_telexNumber('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_TelexNumber(Tlv, [16]); dec_telexNumber('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_telexNumber('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_telexNumber('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% collectiveTelexNumber %%================================ enc_collectiveTelexNumber(derivation, Val, [H|T]) -> enc_telexNumber(H, Val, T); enc_collectiveTelexNumber('Type', Val, _RestPrimFieldName) -> {Val,0}; enc_collectiveTelexNumber('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_collectiveTelexNumber('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_collectiveTelexNumber('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_collectiveTelexNumber(derivation, Bytes,[H|T]) -> dec_telexNumber(H, Bytes, T); dec_collectiveTelexNumber('Type', Bytes,_) -> Bytes; dec_collectiveTelexNumber('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_collectiveTelexNumber('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_collectiveTelexNumber('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% facsimileTelephoneNumber %%================================ enc_facsimileTelephoneNumber(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_facsimileTelephoneNumber('Type', Val, _RestPrimFieldName) -> enc_FacsimileTelephoneNumber(Val, [<<48>>]); enc_facsimileTelephoneNumber('equality-match', Val, [H|T]) -> enc_facsimileNumberMatch(H, Val, T); enc_facsimileTelephoneNumber('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_facsimileTelephoneNumber('substrings-match', Val, [H|T]) -> enc_facsimileNumberSubstringsMatch(H, Val, T). dec_facsimileTelephoneNumber(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_facsimileTelephoneNumber('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_FacsimileTelephoneNumber(Tlv, [16]); dec_facsimileTelephoneNumber('equality-match', Bytes,[H|T]) -> dec_facsimileNumberMatch(H, Bytes, T); dec_facsimileTelephoneNumber('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_facsimileTelephoneNumber('substrings-match', Bytes,[H|T]) -> dec_facsimileNumberSubstringsMatch(H, Bytes, T). %%================================ %% facsimileNumberMatch %%================================ enc_facsimileNumberMatch('AssertionType', Val, _RestPrimFieldName) -> enc_TelephoneNumber(Val, [<<19>>]). dec_facsimileNumberMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_TelephoneNumber(Tlv, [19]). %%================================ %% facsimileNumberSubstringsMatch %%================================ enc_facsimileNumberSubstringsMatch('AssertionType', Val, _RestPrimFieldName) -> enc_SubstringAssertion(Val, [<<48>>]). dec_facsimileNumberSubstringsMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_SubstringAssertion(Tlv, [16]). %%================================ %% collectiveFacsimileTelephoneNumber %%================================ enc_collectiveFacsimileTelephoneNumber(derivation, Val, [H|T]) -> enc_facsimileTelephoneNumber(H, Val, T); enc_collectiveFacsimileTelephoneNumber('Type', Val, _RestPrimFieldName) -> {Val,0}; enc_collectiveFacsimileTelephoneNumber('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_collectiveFacsimileTelephoneNumber('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_collectiveFacsimileTelephoneNumber('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_collectiveFacsimileTelephoneNumber(derivation, Bytes,[H|T]) -> dec_facsimileTelephoneNumber(H, Bytes, T); dec_collectiveFacsimileTelephoneNumber('Type', Bytes,_) -> Bytes; dec_collectiveFacsimileTelephoneNumber('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_collectiveFacsimileTelephoneNumber('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_collectiveFacsimileTelephoneNumber('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% x121Address %%================================ enc_x121Address(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_x121Address('Type', Val, _RestPrimFieldName) -> enc_X121Address(Val, [<<18>>]); enc_x121Address('equality-match', Val, [H|T]) -> enc_numericStringMatch(H, Val, T); enc_x121Address('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_x121Address('substrings-match', Val, [H|T]) -> enc_numericStringSubstringsMatch(H, Val, T). dec_x121Address(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_x121Address('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_X121Address(Tlv, [18]); dec_x121Address('equality-match', Bytes,[H|T]) -> dec_numericStringMatch(H, Bytes, T); dec_x121Address('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_x121Address('substrings-match', Bytes,[H|T]) -> dec_numericStringSubstringsMatch(H, Bytes, T). %%================================ %% internationalISDNNumber %%================================ enc_internationalISDNNumber(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_internationalISDNNumber('Type', Val, _RestPrimFieldName) -> enc_InternationalISDNNumber(Val, [<<18>>]); enc_internationalISDNNumber('equality-match', Val, [H|T]) -> enc_numericStringMatch(H, Val, T); enc_internationalISDNNumber('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_internationalISDNNumber('substrings-match', Val, [H|T]) -> enc_numericStringSubstringsMatch(H, Val, T). dec_internationalISDNNumber(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_internationalISDNNumber('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_InternationalISDNNumber(Tlv, [18]); dec_internationalISDNNumber('equality-match', Bytes,[H|T]) -> dec_numericStringMatch(H, Bytes, T); dec_internationalISDNNumber('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_internationalISDNNumber('substrings-match', Bytes,[H|T]) -> dec_numericStringSubstringsMatch(H, Bytes, T). %%================================ %% collectiveInternationalISDNNumber %%================================ enc_collectiveInternationalISDNNumber(derivation, Val, [H|T]) -> enc_internationalISDNNumber(H, Val, T); enc_collectiveInternationalISDNNumber('Type', Val, _RestPrimFieldName) -> {Val,0}; enc_collectiveInternationalISDNNumber('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_collectiveInternationalISDNNumber('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_collectiveInternationalISDNNumber('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_collectiveInternationalISDNNumber(derivation, Bytes,[H|T]) -> dec_internationalISDNNumber(H, Bytes, T); dec_collectiveInternationalISDNNumber('Type', Bytes,_) -> Bytes; dec_collectiveInternationalISDNNumber('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_collectiveInternationalISDNNumber('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_collectiveInternationalISDNNumber('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% registeredAddress %%================================ enc_registeredAddress(derivation, Val, [H|T]) -> enc_postalAddress(H, Val, T); enc_registeredAddress('Type', Val, _RestPrimFieldName) -> enc_PostalAddress(Val, [<<48>>]); enc_registeredAddress('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_registeredAddress('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_registeredAddress('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_registeredAddress(derivation, Bytes,[H|T]) -> dec_postalAddress(H, Bytes, T); dec_registeredAddress('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_PostalAddress(Tlv, [16]); dec_registeredAddress('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_registeredAddress('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_registeredAddress('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% destinationIndicator %%================================ enc_destinationIndicator(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_destinationIndicator('Type', Val, _RestPrimFieldName) -> enc_DestinationIndicator(Val, [<<19>>]); enc_destinationIndicator('equality-match', Val, [H|T]) -> enc_caseIgnoreMatch(H, Val, T); enc_destinationIndicator('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_destinationIndicator('substrings-match', Val, [H|T]) -> enc_caseIgnoreSubstringsMatch(H, Val, T). dec_destinationIndicator(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_destinationIndicator('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_DestinationIndicator(Tlv, [19]); dec_destinationIndicator('equality-match', Bytes,[H|T]) -> dec_caseIgnoreMatch(H, Bytes, T); dec_destinationIndicator('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_destinationIndicator('substrings-match', Bytes,[H|T]) -> dec_caseIgnoreSubstringsMatch(H, Bytes, T). %%================================ %% communicationsService %%================================ enc_communicationsService(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_communicationsService('Type', Val, _RestPrimFieldName) -> encode_object_identifier(Val, [<<6>>]); enc_communicationsService('equality-match', Val, [H|T]) -> 'InformationFramework':enc_objectIdentifierMatch(H, Val, T); enc_communicationsService('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_communicationsService('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_communicationsService(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_communicationsService('Type', Bytes,_) -> Tlv = tlv_format(Bytes), decode_object_identifier(Tlv, [6]); dec_communicationsService('equality-match', Bytes,[H|T]) -> 'InformationFramework':dec_objectIdentifierMatch(H, Bytes, T); dec_communicationsService('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_communicationsService('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% communicationsNetwork %%================================ enc_communicationsNetwork(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_communicationsNetwork('Type', Val, _RestPrimFieldName) -> encode_object_identifier(Val, [<<6>>]); enc_communicationsNetwork('equality-match', Val, [H|T]) -> 'InformationFramework':enc_objectIdentifierMatch(H, Val, T); enc_communicationsNetwork('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_communicationsNetwork('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_communicationsNetwork(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_communicationsNetwork('Type', Bytes,_) -> Tlv = tlv_format(Bytes), decode_object_identifier(Tlv, [6]); dec_communicationsNetwork('equality-match', Bytes,[H|T]) -> 'InformationFramework':dec_objectIdentifierMatch(H, Bytes, T); dec_communicationsNetwork('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_communicationsNetwork('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% preferredDeliveryMethod %%================================ enc_preferredDeliveryMethod(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_preferredDeliveryMethod('Type', Val, _RestPrimFieldName) -> enc_PreferredDeliveryMethod(Val, [<<48>>]); enc_preferredDeliveryMethod('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_preferredDeliveryMethod('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_preferredDeliveryMethod('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_preferredDeliveryMethod(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_preferredDeliveryMethod('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_PreferredDeliveryMethod(Tlv, [16]); dec_preferredDeliveryMethod('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_preferredDeliveryMethod('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_preferredDeliveryMethod('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% presentationAddress %%================================ enc_presentationAddress(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_presentationAddress('Type', Val, _RestPrimFieldName) -> enc_PresentationAddress(Val, [<<48>>]); enc_presentationAddress('equality-match', Val, [H|T]) -> enc_presentationAddressMatch(H, Val, T); enc_presentationAddress('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_presentationAddress('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_presentationAddress(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_presentationAddress('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_PresentationAddress(Tlv, [16]); dec_presentationAddress('equality-match', Bytes,[H|T]) -> dec_presentationAddressMatch(H, Bytes, T); dec_presentationAddress('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_presentationAddress('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% supportedApplicationContext %%================================ enc_supportedApplicationContext(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_supportedApplicationContext('Type', Val, _RestPrimFieldName) -> encode_object_identifier(Val, [<<6>>]); enc_supportedApplicationContext('equality-match', Val, [H|T]) -> 'InformationFramework':enc_objectIdentifierMatch(H, Val, T); enc_supportedApplicationContext('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_supportedApplicationContext('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_supportedApplicationContext(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_supportedApplicationContext('Type', Bytes,_) -> Tlv = tlv_format(Bytes), decode_object_identifier(Tlv, [6]); dec_supportedApplicationContext('equality-match', Bytes,[H|T]) -> 'InformationFramework':dec_objectIdentifierMatch(H, Bytes, T); dec_supportedApplicationContext('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_supportedApplicationContext('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% protocolInformation %%================================ enc_protocolInformation(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_protocolInformation('Type', Val, _RestPrimFieldName) -> enc_ProtocolInformation(Val, [<<48>>]); enc_protocolInformation('equality-match', Val, [H|T]) -> enc_protocolInformationMatch(H, Val, T); enc_protocolInformation('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_protocolInformation('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_protocolInformation(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_protocolInformation('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_ProtocolInformation(Tlv, [16]); dec_protocolInformation('equality-match', Bytes,[H|T]) -> dec_protocolInformationMatch(H, Bytes, T); dec_protocolInformation('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_protocolInformation('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% distinguishedName %%================================ enc_distinguishedName(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_distinguishedName('Type', Val, _RestPrimFieldName) -> 'InformationFramework':enc_DistinguishedName(Val, [<<48>>]); enc_distinguishedName('equality-match', Val, [H|T]) -> 'InformationFramework':enc_distinguishedNameMatch(H, Val, T); enc_distinguishedName('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_distinguishedName('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_distinguishedName(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_distinguishedName('Type', Bytes,_) -> Tlv = tlv_format(Bytes), 'InformationFramework':dec_DistinguishedName(Tlv, [16]); dec_distinguishedName('equality-match', Bytes,[H|T]) -> 'InformationFramework':dec_distinguishedNameMatch(H, Bytes, T); dec_distinguishedName('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_distinguishedName('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% member %%================================ enc_member(derivation, Val, [H|T]) -> enc_distinguishedName(H, Val, T); enc_member('Type', Val, _RestPrimFieldName) -> {Val,0}; enc_member('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_member('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_member('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_member(derivation, Bytes,[H|T]) -> dec_distinguishedName(H, Bytes, T); dec_member('Type', Bytes,_) -> Bytes; dec_member('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_member('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_member('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% uniqueMember %%================================ enc_uniqueMember(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_uniqueMember('Type', Val, _RestPrimFieldName) -> enc_NameAndOptionalUID(Val, [<<48>>]); enc_uniqueMember('equality-match', Val, [H|T]) -> enc_uniqueMemberMatch(H, Val, T); enc_uniqueMember('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_uniqueMember('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_uniqueMember(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_uniqueMember('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_NameAndOptionalUID(Tlv, [16]); dec_uniqueMember('equality-match', Bytes,[H|T]) -> dec_uniqueMemberMatch(H, Bytes, T); dec_uniqueMember('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_uniqueMember('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% owner %%================================ enc_owner(derivation, Val, [H|T]) -> enc_distinguishedName(H, Val, T); enc_owner('Type', Val, _RestPrimFieldName) -> {Val,0}; enc_owner('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_owner('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_owner('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_owner(derivation, Bytes,[H|T]) -> dec_distinguishedName(H, Bytes, T); dec_owner('Type', Bytes,_) -> Bytes; dec_owner('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_owner('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_owner('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% roleOccupant %%================================ enc_roleOccupant(derivation, Val, [H|T]) -> enc_distinguishedName(H, Val, T); enc_roleOccupant('Type', Val, _RestPrimFieldName) -> {Val,0}; enc_roleOccupant('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_roleOccupant('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_roleOccupant('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_roleOccupant(derivation, Bytes,[H|T]) -> dec_distinguishedName(H, Bytes, T); dec_roleOccupant('Type', Bytes,_) -> Bytes; dec_roleOccupant('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_roleOccupant('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_roleOccupant('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% seeAlso %%================================ enc_seeAlso(derivation, Val, [H|T]) -> enc_distinguishedName(H, Val, T); enc_seeAlso('Type', Val, _RestPrimFieldName) -> {Val,0}; enc_seeAlso('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_seeAlso('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_seeAlso('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_seeAlso(derivation, Bytes,[H|T]) -> dec_distinguishedName(H, Bytes, T); dec_seeAlso('Type', Bytes,_) -> Bytes; dec_seeAlso('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_seeAlso('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_seeAlso('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% dmdName %%================================ enc_dmdName(derivation, Val, [H|T]) -> enc_name(H, Val, T); enc_dmdName('Type', Val, _RestPrimFieldName) -> enc_dmdName_DirectoryString(Val,[]); enc_dmdName('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_dmdName('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_dmdName('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_dmdName(derivation, Bytes,[H|T]) -> dec_name(H, Bytes, T); dec_dmdName('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_dmdName_DirectoryString(Tlv,[]); dec_dmdName('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_dmdName('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_dmdName('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% dSAProblem %%================================ enc_dSAProblem(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_dSAProblem('Type', Val, _RestPrimFieldName) -> encode_object_identifier(Val, [<<6>>]); enc_dSAProblem('equality-match', Val, [H|T]) -> 'InformationFramework':enc_objectIdentifierMatch(H, Val, T); enc_dSAProblem('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_dSAProblem('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_dSAProblem(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_dSAProblem('Type', Bytes,_) -> Tlv = tlv_format(Bytes), decode_object_identifier(Tlv, [6]); dec_dSAProblem('equality-match', Bytes,[H|T]) -> 'InformationFramework':dec_objectIdentifierMatch(H, Bytes, T); dec_dSAProblem('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_dSAProblem('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% searchServiceProblem %%================================ enc_searchServiceProblem(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_searchServiceProblem('Type', Val, _RestPrimFieldName) -> encode_object_identifier(Val, [<<6>>]); enc_searchServiceProblem('equality-match', Val, [H|T]) -> 'InformationFramework':enc_objectIdentifierMatch(H, Val, T); enc_searchServiceProblem('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_searchServiceProblem('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_searchServiceProblem(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_searchServiceProblem('Type', Bytes,_) -> Tlv = tlv_format(Bytes), decode_object_identifier(Tlv, [6]); dec_searchServiceProblem('equality-match', Bytes,[H|T]) -> 'InformationFramework':dec_objectIdentifierMatch(H, Bytes, T); dec_searchServiceProblem('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_searchServiceProblem('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% serviceType %%================================ enc_serviceType(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_serviceType('Type', Val, _RestPrimFieldName) -> encode_object_identifier(Val, [<<6>>]); enc_serviceType('equality-match', Val, [H|T]) -> 'InformationFramework':enc_objectIdentifierMatch(H, Val, T); enc_serviceType('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_serviceType('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_serviceType(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_serviceType('Type', Bytes,_) -> Tlv = tlv_format(Bytes), decode_object_identifier(Tlv, [6]); dec_serviceType('equality-match', Bytes,[H|T]) -> 'InformationFramework':dec_objectIdentifierMatch(H, Bytes, T); dec_serviceType('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_serviceType('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% attributeTypeList %%================================ enc_attributeTypeList(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_attributeTypeList('Type', Val, _RestPrimFieldName) -> encode_object_identifier(Val, [<<6>>]); enc_attributeTypeList('equality-match', Val, [H|T]) -> 'InformationFramework':enc_objectIdentifierMatch(H, Val, T); enc_attributeTypeList('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_attributeTypeList('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_attributeTypeList(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_attributeTypeList('Type', Bytes,_) -> Tlv = tlv_format(Bytes), decode_object_identifier(Tlv, [6]); dec_attributeTypeList('equality-match', Bytes,[H|T]) -> 'InformationFramework':dec_objectIdentifierMatch(H, Bytes, T); dec_attributeTypeList('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_attributeTypeList('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% filterItem %%================================ enc_filterItem(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_filterItem('Type', Val, _RestPrimFieldName) -> 'DirectoryAbstractService':enc_FilterItem(Val, []); enc_filterItem('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_filterItem('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_filterItem('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_filterItem(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_filterItem('Type', Bytes,_) -> Tlv = tlv_format(Bytes), 'DirectoryAbstractService':dec_FilterItem(Tlv, []); dec_filterItem('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_filterItem('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_filterItem('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% attributeCombinations %%================================ enc_attributeCombinations(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_attributeCombinations('Type', Val, _RestPrimFieldName) -> 'InformationFramework':enc_AttributeCombination(Val, []); enc_attributeCombinations('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_attributeCombinations('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_attributeCombinations('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_attributeCombinations(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_attributeCombinations('Type', Bytes,_) -> Tlv = tlv_format(Bytes), 'InformationFramework':dec_AttributeCombination(Tlv, []); dec_attributeCombinations('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_attributeCombinations('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_attributeCombinations('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% contextTypeList %%================================ enc_contextTypeList(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_contextTypeList('Type', Val, _RestPrimFieldName) -> encode_object_identifier(Val, [<<6>>]); enc_contextTypeList('equality-match', Val, [H|T]) -> 'InformationFramework':enc_objectIdentifierMatch(H, Val, T); enc_contextTypeList('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_contextTypeList('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_contextTypeList(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_contextTypeList('Type', Bytes,_) -> Tlv = tlv_format(Bytes), decode_object_identifier(Tlv, [6]); dec_contextTypeList('equality-match', Bytes,[H|T]) -> 'InformationFramework':dec_objectIdentifierMatch(H, Bytes, T); dec_contextTypeList('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_contextTypeList('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% contextList %%================================ enc_contextList(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_contextList('Type', Val, _RestPrimFieldName) -> 'InformationFramework':enc_ContextAssertion(Val, [<<48>>]); enc_contextList('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_contextList('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_contextList('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_contextList(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_contextList('Type', Bytes,_) -> Tlv = tlv_format(Bytes), 'InformationFramework':dec_ContextAssertion(Tlv, [16]); dec_contextList('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_contextList('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_contextList('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% hierarchySelectList %%================================ enc_hierarchySelectList(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_hierarchySelectList('Type', Val, _RestPrimFieldName) -> 'DirectoryAbstractService':enc_HierarchySelections(Val, [<<3>>]); enc_hierarchySelectList('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_hierarchySelectList('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_hierarchySelectList('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_hierarchySelectList(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_hierarchySelectList('Type', Bytes,_) -> Tlv = tlv_format(Bytes), 'DirectoryAbstractService':dec_HierarchySelections(Tlv, [3]); dec_hierarchySelectList('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_hierarchySelectList('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_hierarchySelectList('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% searchOptionsList %%================================ enc_searchOptionsList(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_searchOptionsList('Type', Val, _RestPrimFieldName) -> 'DirectoryAbstractService':enc_SearchControlOptions(Val, [<<3>>]); enc_searchOptionsList('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_searchOptionsList('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_searchOptionsList('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_searchOptionsList(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_searchOptionsList('Type', Bytes,_) -> Tlv = tlv_format(Bytes), 'DirectoryAbstractService':dec_SearchControlOptions(Tlv, [3]); dec_searchOptionsList('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_searchOptionsList('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_searchOptionsList('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% serviceControlOptionsList %%================================ enc_serviceControlOptionsList(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_serviceControlOptionsList('Type', Val, _RestPrimFieldName) -> 'DirectoryAbstractService':enc_ServiceControlOptions(Val, [<<3>>]); enc_serviceControlOptionsList('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_serviceControlOptionsList('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_serviceControlOptionsList('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_serviceControlOptionsList(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_serviceControlOptionsList('Type', Bytes,_) -> Tlv = tlv_format(Bytes), 'DirectoryAbstractService':dec_ServiceControlOptions(Tlv, [3]); dec_serviceControlOptionsList('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_serviceControlOptionsList('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_serviceControlOptionsList('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% multipleMatchingLocalities %%================================ enc_multipleMatchingLocalities(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_multipleMatchingLocalities('Type', Val, _RestPrimFieldName) -> enc_MultipleMatchingLocalities(Val, [<<48>>]); enc_multipleMatchingLocalities('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_multipleMatchingLocalities('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_multipleMatchingLocalities('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_multipleMatchingLocalities(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_multipleMatchingLocalities('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_MultipleMatchingLocalities(Tlv, [16]); dec_multipleMatchingLocalities('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_multipleMatchingLocalities('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_multipleMatchingLocalities('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% proposedRelaxation %%================================ enc_proposedRelaxation(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_proposedRelaxation('Type', Val, _RestPrimFieldName) -> enc_proposedRelaxation_Type(Val,[<<48>>]); enc_proposedRelaxation('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_proposedRelaxation('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_proposedRelaxation('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). %%================================ %% proposedRelaxation_Type %%================================ enc_proposedRelaxation_Type(Val, TagIn) -> {EncBytes,EncLen} = 'enc_proposedRelaxation_Type_components'(Val,[],0), encode_tags(TagIn, EncBytes, EncLen). 'enc_proposedRelaxation_Type_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen}; 'enc_proposedRelaxation_Type_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = 'InformationFramework':'enc_MRMapping'(H, [<<48>>]), 'enc_proposedRelaxation_Type_components'(T,[EncBytes|AccBytes], AccLen + EncLen). dec_proposedRelaxation(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_proposedRelaxation('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_proposedRelaxation_Type(Tlv,[16]); dec_proposedRelaxation('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_proposedRelaxation('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_proposedRelaxation('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). 'dec_proposedRelaxation_Type'(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- Tlv1 = match_tags(Tlv, TagIn), ['InformationFramework':'dec_MRMapping'(V1, [16]) || V1 <- Tlv1]. %%================================ %% appliedRelaxation %%================================ enc_appliedRelaxation(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_appliedRelaxation('Type', Val, _RestPrimFieldName) -> encode_object_identifier(Val, [<<6>>]); enc_appliedRelaxation('equality-match', Val, [H|T]) -> 'InformationFramework':enc_objectIdentifierMatch(H, Val, T); enc_appliedRelaxation('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_appliedRelaxation('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_appliedRelaxation(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_appliedRelaxation('Type', Bytes,_) -> Tlv = tlv_format(Bytes), decode_object_identifier(Tlv, [6]); dec_appliedRelaxation('equality-match', Bytes,[H|T]) -> 'InformationFramework':dec_objectIdentifierMatch(H, Bytes, T); dec_appliedRelaxation('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_appliedRelaxation('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% caseIgnoreMatch %%================================ enc_caseIgnoreMatch('AssertionType', Val, _RestPrimFieldName) -> enc_caseIgnoreMatch_DirectoryString(Val,[]). dec_caseIgnoreMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_caseIgnoreMatch_DirectoryString(Tlv,[]). %%================================ %% caseIgnoreOrderingMatch %%================================ enc_caseIgnoreOrderingMatch('AssertionType', Val, _RestPrimFieldName) -> enc_caseIgnoreOrderingMatch_DirectoryString(Val,[]). dec_caseIgnoreOrderingMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_caseIgnoreOrderingMatch_DirectoryString(Tlv,[]). %%================================ %% caseIgnoreSubstringsMatch %%================================ enc_caseIgnoreSubstringsMatch('AssertionType', Val, _RestPrimFieldName) -> enc_SubstringAssertion(Val, [<<48>>]). dec_caseIgnoreSubstringsMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_SubstringAssertion(Tlv, [16]). %%================================ %% caseExactMatch %%================================ enc_caseExactMatch('AssertionType', Val, _RestPrimFieldName) -> enc_caseExactMatch_DirectoryString(Val,[]). dec_caseExactMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_caseExactMatch_DirectoryString(Tlv,[]). %%================================ %% caseExactOrderingMatch %%================================ enc_caseExactOrderingMatch('AssertionType', Val, _RestPrimFieldName) -> enc_caseExactOrderingMatch_DirectoryString(Val,[]). dec_caseExactOrderingMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_caseExactOrderingMatch_DirectoryString(Tlv,[]). %%================================ %% caseExactSubstringsMatch %%================================ enc_caseExactSubstringsMatch('AssertionType', Val, _RestPrimFieldName) -> enc_SubstringAssertion(Val, [<<48>>]). dec_caseExactSubstringsMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_SubstringAssertion(Tlv, [16]). %%================================ %% numericStringMatch %%================================ enc_numericStringMatch('AssertionType', Val, _RestPrimFieldName) -> encode_restricted_string(Val, [<<18>>]). dec_numericStringMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), begin binary_to_list(decode_restricted_string(Tlv, [18])) end . %%================================ %% numericStringOrderingMatch %%================================ enc_numericStringOrderingMatch('AssertionType', Val, _RestPrimFieldName) -> encode_restricted_string(Val, [<<18>>]). dec_numericStringOrderingMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), begin binary_to_list(decode_restricted_string(Tlv, [18])) end . %%================================ %% numericStringSubstringsMatch %%================================ enc_numericStringSubstringsMatch('AssertionType', Val, _RestPrimFieldName) -> enc_SubstringAssertion(Val, [<<48>>]). dec_numericStringSubstringsMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_SubstringAssertion(Tlv, [16]). %%================================ %% caseIgnoreListMatch %%================================ enc_caseIgnoreListMatch('AssertionType', Val, _RestPrimFieldName) -> enc_CaseIgnoreListMatch(Val, [<<48>>]). dec_caseIgnoreListMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_CaseIgnoreListMatch(Tlv, [16]). %%================================ %% caseIgnoreListSubstringsMatch %%================================ enc_caseIgnoreListSubstringsMatch('AssertionType', Val, _RestPrimFieldName) -> enc_SubstringAssertion(Val, [<<48>>]). dec_caseIgnoreListSubstringsMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_SubstringAssertion(Tlv, [16]). %%================================ %% storedPrefixMatch %%================================ enc_storedPrefixMatch('AssertionType', Val, _RestPrimFieldName) -> enc_storedPrefixMatch_DirectoryString(Val,[]). dec_storedPrefixMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_storedPrefixMatch_DirectoryString(Tlv,[]). %%================================ %% booleanMatch %%================================ enc_booleanMatch('AssertionType', Val, _RestPrimFieldName) -> encode_boolean(Val, [<<1>>]). dec_booleanMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), decode_boolean(Tlv, [1]). %%================================ %% integerMatch %%================================ enc_integerMatch('AssertionType', Val, _RestPrimFieldName) -> encode_integer(Val, [<<2>>]). dec_integerMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), decode_integer(Tlv, [2]). %%================================ %% integerOrderingMatch %%================================ enc_integerOrderingMatch('AssertionType', Val, _RestPrimFieldName) -> encode_integer(Val, [<<2>>]). dec_integerOrderingMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), decode_integer(Tlv, [2]). %%================================ %% bitStringMatch %%================================ enc_bitStringMatch('AssertionType', Val, _RestPrimFieldName) -> encode_unnamed_bit_string(Val, [<<3>>]). dec_bitStringMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), decode_native_bit_string(Tlv, [3]). %%================================ %% octetStringMatch %%================================ enc_octetStringMatch('AssertionType', Val, _RestPrimFieldName) -> encode_restricted_string(Val, [<<4>>]). dec_octetStringMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), decode_octet_string(Tlv, [4]). %%================================ %% octetStringOrderingMatch %%================================ enc_octetStringOrderingMatch('AssertionType', Val, _RestPrimFieldName) -> encode_restricted_string(Val, [<<4>>]). dec_octetStringOrderingMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), decode_octet_string(Tlv, [4]). %%================================ %% octetStringSubstringsMatch %%================================ enc_octetStringSubstringsMatch('AssertionType', Val, _RestPrimFieldName) -> enc_OctetSubstringAssertion(Val, [<<48>>]). dec_octetStringSubstringsMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_OctetSubstringAssertion(Tlv, [16]). %%================================ %% telephoneNumberMatch %%================================ enc_telephoneNumberMatch('AssertionType', Val, _RestPrimFieldName) -> enc_TelephoneNumber(Val, [<<19>>]). dec_telephoneNumberMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_TelephoneNumber(Tlv, [19]). %%================================ %% telephoneNumberSubstringsMatch %%================================ enc_telephoneNumberSubstringsMatch('AssertionType', Val, _RestPrimFieldName) -> enc_SubstringAssertion(Val, [<<48>>]). dec_telephoneNumberSubstringsMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_SubstringAssertion(Tlv, [16]). %%================================ %% presentationAddressMatch %%================================ enc_presentationAddressMatch('AssertionType', Val, _RestPrimFieldName) -> enc_PresentationAddress(Val, [<<48>>]). dec_presentationAddressMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_PresentationAddress(Tlv, [16]). %%================================ %% uniqueMemberMatch %%================================ enc_uniqueMemberMatch('AssertionType', Val, _RestPrimFieldName) -> enc_NameAndOptionalUID(Val, [<<48>>]). dec_uniqueMemberMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_NameAndOptionalUID(Tlv, [16]). %%================================ %% protocolInformationMatch %%================================ enc_protocolInformationMatch('AssertionType', Val, _RestPrimFieldName) -> encode_restricted_string(Val, [<<4>>]). dec_protocolInformationMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), decode_octet_string(Tlv, [4]). %%================================ %% uTCTimeMatch %%================================ enc_uTCTimeMatch('AssertionType', Val, _RestPrimFieldName) -> encode_restricted_string(Val, [<<23>>]). dec_uTCTimeMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), begin binary_to_list(decode_restricted_string(Tlv, [23])) end . %%================================ %% uTCTimeOrderingMatch %%================================ enc_uTCTimeOrderingMatch('AssertionType', Val, _RestPrimFieldName) -> encode_restricted_string(Val, [<<23>>]). dec_uTCTimeOrderingMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), begin binary_to_list(decode_restricted_string(Tlv, [23])) end . %%================================ %% generalizedTimeMatch %%================================ enc_generalizedTimeMatch('AssertionType', Val, _RestPrimFieldName) -> encode_restricted_string(Val, [<<24>>]). dec_generalizedTimeMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), begin binary_to_list(decode_restricted_string(Tlv, [24])) end . %%================================ %% generalizedTimeOrderingMatch %%================================ enc_generalizedTimeOrderingMatch('AssertionType', Val, _RestPrimFieldName) -> encode_restricted_string(Val, [<<24>>]). dec_generalizedTimeOrderingMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), begin binary_to_list(decode_restricted_string(Tlv, [24])) end . %%================================ %% integerFirstComponentMatch %%================================ enc_integerFirstComponentMatch('AssertionType', Val, _RestPrimFieldName) -> encode_integer(Val, [<<2>>]). dec_integerFirstComponentMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), decode_integer(Tlv, [2]). %%================================ %% objectIdentifierFirstComponentMatch %%================================ enc_objectIdentifierFirstComponentMatch('AssertionType', Val, _RestPrimFieldName) -> encode_object_identifier(Val, [<<6>>]). dec_objectIdentifierFirstComponentMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), decode_object_identifier(Tlv, [6]). %%================================ %% directoryStringFirstComponentMatch %%================================ enc_directoryStringFirstComponentMatch('AssertionType', Val, _RestPrimFieldName) -> enc_directoryStringFirstComponentMatch_DirectoryString(Val,[]). dec_directoryStringFirstComponentMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_directoryStringFirstComponentMatch_DirectoryString(Tlv,[]). %%================================ %% wordMatch %%================================ enc_wordMatch('AssertionType', Val, _RestPrimFieldName) -> enc_wordMatch_DirectoryString(Val,[]). dec_wordMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_wordMatch_DirectoryString(Tlv,[]). %%================================ %% keywordMatch %%================================ enc_keywordMatch('AssertionType', Val, _RestPrimFieldName) -> enc_keywordMatch_DirectoryString(Val,[]). dec_keywordMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_keywordMatch_DirectoryString(Tlv,[]). %%================================ %% systemProposedMatch %%================================ enc_systemProposedMatch('AssertionType', Val, _RestPrimFieldName) -> {Val,0}. dec_systemProposedMatch('AssertionType', Bytes,_) -> Bytes. %%================================ %% generalWordMatch %%================================ enc_generalWordMatch('AssertionType', Val, _RestPrimFieldName) -> enc_SubstringAssertion(Val, [<<48>>]). dec_generalWordMatch('AssertionType', Bytes,_) -> Tlv = tlv_format(Bytes), dec_SubstringAssertion(Tlv, [16]). %%================================ %% sequenceMatchType %%================================ enc_sequenceMatchType(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_sequenceMatchType('Type', Val, _RestPrimFieldName) -> case Val of sequenceExact -> encode_tags([<<10>>], [0], 1); sequenceDeletion -> encode_tags([<<10>>], [1], 1); sequenceRestrictedDeletion -> encode_tags([<<10>>], [2], 1); sequencePermutation -> encode_tags([<<10>>], [3], 1); sequencePermutationAndDeletion -> encode_tags([<<10>>], [4], 1); sequenceProviderDefined -> encode_tags([<<10>>], [5], 1); Enumval1 -> exit({error,{asn1, {enumerated_not_in_range,Enumval1}}}) end; enc_sequenceMatchType('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_sequenceMatchType('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_sequenceMatchType('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_sequenceMatchType(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_sequenceMatchType('Type', Bytes,_) -> Tlv = tlv_format(Bytes), case decode_integer(Tlv, [10]) of 0 -> sequenceExact; 1 -> sequenceDeletion; 2 -> sequenceRestrictedDeletion; 3 -> sequencePermutation; 4 -> sequencePermutationAndDeletion; 5 -> sequenceProviderDefined; Default1 -> exit({error,{asn1,{illegal_enumerated,Default1}}}) end; dec_sequenceMatchType('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_sequenceMatchType('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_sequenceMatchType('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% wordMatchTypes %%================================ enc_wordMatchTypes(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_wordMatchTypes('Type', Val, _RestPrimFieldName) -> case Val of wordExact -> encode_tags([<<10>>], [0], 1); wordTruncated -> encode_tags([<<10>>], [1], 1); wordPhonetic -> encode_tags([<<10>>], [2], 1); wordProviderDefined -> encode_tags([<<10>>], [3], 1); Enumval1 -> exit({error,{asn1, {enumerated_not_in_range,Enumval1}}}) end; enc_wordMatchTypes('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_wordMatchTypes('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_wordMatchTypes('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_wordMatchTypes(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_wordMatchTypes('Type', Bytes,_) -> Tlv = tlv_format(Bytes), case decode_integer(Tlv, [10]) of 0 -> wordExact; 1 -> wordTruncated; 2 -> wordPhonetic; 3 -> wordProviderDefined; Default1 -> exit({error,{asn1,{illegal_enumerated,Default1}}}) end; dec_wordMatchTypes('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_wordMatchTypes('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_wordMatchTypes('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% characterMatchTypes %%================================ enc_characterMatchTypes(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_characterMatchTypes('Type', Val, _RestPrimFieldName) -> case Val of characterExact -> encode_tags([<<10>>], [0], 1); characterCaseIgnore -> encode_tags([<<10>>], [1], 1); characterMapped -> encode_tags([<<10>>], [2], 1); Enumval1 -> exit({error,{asn1, {enumerated_not_in_range,Enumval1}}}) end; enc_characterMatchTypes('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_characterMatchTypes('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_characterMatchTypes('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_characterMatchTypes(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_characterMatchTypes('Type', Bytes,_) -> Tlv = tlv_format(Bytes), case decode_integer(Tlv, [10]) of 0 -> characterExact; 1 -> characterCaseIgnore; 2 -> characterMapped; Default1 -> exit({error,{asn1,{illegal_enumerated,Default1}}}) end; dec_characterMatchTypes('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_characterMatchTypes('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_characterMatchTypes('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% selectedContexts %%================================ enc_selectedContexts(derivation, _,_) -> exit({error,{'use of missing field in object', derivation}}); enc_selectedContexts('Type', Val, _RestPrimFieldName) -> 'InformationFramework':enc_ContextAssertion(Val, [<<48>>]); enc_selectedContexts('equality-match', _,_) -> exit({error,{'use of missing field in object', 'equality-match'}}); enc_selectedContexts('ordering-match', _,_) -> exit({error,{'use of missing field in object', 'ordering-match'}}); enc_selectedContexts('substrings-match', _,_) -> exit({error,{'use of missing field in object', 'substrings-match'}}). dec_selectedContexts(derivation, _,_) -> exit({error,{'illegal use of missing field in object', derivation}}); dec_selectedContexts('Type', Bytes,_) -> Tlv = tlv_format(Bytes), 'InformationFramework':dec_ContextAssertion(Tlv, [16]); dec_selectedContexts('equality-match', _,_) -> exit({error,{'illegal use of missing field in object', 'equality-match'}}); dec_selectedContexts('ordering-match', _,_) -> exit({error,{'illegal use of missing field in object', 'ordering-match'}}); dec_selectedContexts('substrings-match', _,_) -> exit({error,{'illegal use of missing field in object', 'substrings-match'}}). %%================================ %% approximateStringMatch %%================================ enc_approximateStringMatch('AssertionType', Val, _RestPrimFieldName) -> {Val,0}. dec_approximateStringMatch('AssertionType', Bytes,_) -> Bytes. %%================================ %% ignoreIfAbsentMatch %%================================ enc_ignoreIfAbsentMatch('AssertionType', Val, _RestPrimFieldName) -> {Val,0}. dec_ignoreIfAbsentMatch('AssertionType', Bytes,_) -> Bytes. %%================================ %% nullMatch %%================================ enc_nullMatch('AssertionType', Val, _RestPrimFieldName) -> {Val,0}. dec_nullMatch('AssertionType', Bytes,_) -> Bytes. %%================================ %% zonalMatch %%================================ enc_zonalMatch('AssertionType', Val, _RestPrimFieldName) -> {Val,0}. dec_zonalMatch('AssertionType', Bytes,_) -> Bytes. %%================================ %% languageContext %%================================ enc_languageContext('Type', Val, _RestPrimFieldName) -> enc_LanguageContextSyntax(Val, [<<19>>]); enc_languageContext('Assertion', Val, _RestPrimFieldName) -> {Val,0}. dec_languageContext('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_LanguageContextSyntax(Tlv, [19]); dec_languageContext('Assertion', Bytes,_) -> Bytes. %%================================ %% temporalContext %%================================ enc_temporalContext('Type', Val, _RestPrimFieldName) -> enc_TimeSpecification(Val, [<<48>>]); enc_temporalContext('Assertion', Val, _RestPrimFieldName) -> enc_TimeAssertion(Val, []). dec_temporalContext('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_TimeSpecification(Tlv, [16]); dec_temporalContext('Assertion', Bytes,_) -> Tlv = tlv_format(Bytes), dec_TimeAssertion(Tlv, []). %%================================ %% localeContext %%================================ enc_localeContext('Type', Val, _RestPrimFieldName) -> enc_LocaleContextSyntax(Val, []); enc_localeContext('Assertion', Val, _RestPrimFieldName) -> {Val,0}. dec_localeContext('Type', Bytes,_) -> Tlv = tlv_format(Bytes), dec_LocaleContextSyntax(Tlv, []); dec_localeContext('Assertion', Bytes,_) -> Bytes. %%% %%% Run-time functions. %%% 'dialyzer-suppressions'(Arg) -> ok. ber_decode_nif(B) -> asn1rt_nif:decode_ber_tlv(B). collect_parts(TlvList) -> collect_parts(TlvList, []). collect_parts([{_, L} | Rest], Acc) when is_list(L) -> collect_parts(Rest, [collect_parts(L) | Acc]); collect_parts([{3, <>} | Rest], _Acc) -> collect_parts_bit(Rest, [Bits], Unused); collect_parts([{_T, V} | Rest], Acc) -> collect_parts(Rest, [V | Acc]); collect_parts([], Acc) -> list_to_binary(lists:reverse(Acc)). collect_parts_bit([{3, <>} | Rest], Acc, Uacc) -> collect_parts_bit(Rest, [Bits | Acc], Unused + Uacc); collect_parts_bit([], Acc, Uacc) -> list_to_binary([Uacc | lists:reverse(Acc)]). dec_subidentifiers(<<>>, _Av, Al) -> lists:reverse(Al); dec_subidentifiers(<<1:1,H:7,T/binary>>, Av, Al) -> dec_subidentifiers(T, Av bsl 7 + H, Al); dec_subidentifiers(<>, Av, Al) -> dec_subidentifiers(T, 0, [Av bsl 7 + H | Al]). decode_BMP_string(Buffer, Tags) -> Bin = match_and_collect(Buffer, Tags), mk_BMP_string(binary_to_list(Bin)). decode_UTF8_string(Tlv, TagsIn) -> Val = match_tags(Tlv, TagsIn), case Val of [_ | _] = PartList -> collect_parts(PartList); Bin -> Bin end. decode_bitstring2(1, Unused, <>) -> lists:sublist([B7, B6, B5, B4, B3, B2, B1, B0], 8 - Unused); decode_bitstring2(Len, Unused, <>) -> [B7, B6, B5, B4, B3, B2, B1, B0 | decode_bitstring2(Len - 1, Unused, Buffer)]. decode_bitstring_NNL(BitList, NamedNumberList) -> decode_bitstring_NNL(BitList, NamedNumberList, 0, []). decode_bitstring_NNL([], _, _No, Result) -> lists:reverse(Result); decode_bitstring_NNL([B | BitList], [{Name, No} | NamedNumberList], No, Result) -> if B =:= 0 -> decode_bitstring_NNL(BitList, NamedNumberList, No + 1, Result); true -> decode_bitstring_NNL(BitList, NamedNumberList, No + 1, [Name | Result]) end; decode_bitstring_NNL([1 | BitList], NamedNumberList, No, Result) -> decode_bitstring_NNL(BitList, NamedNumberList, No + 1, [{bit, No} | Result]); decode_bitstring_NNL([0 | BitList], NamedNumberList, No, Result) -> decode_bitstring_NNL(BitList, NamedNumberList, No + 1, Result). decode_boolean(Tlv, TagIn) -> Val = match_tags(Tlv, TagIn), case Val of <<0:8>> -> false; <<_:8>> -> true; _ -> exit({error, {asn1, {decode_boolean, Val}}}) end. decode_integer(Tlv, TagIn) -> Bin = match_tags(Tlv, TagIn), Len = byte_size(Bin), <> = Bin, Int. decode_named_bit_string(Buffer, NamedNumberList, Tags) -> case match_and_collect(Buffer, Tags) of <<0>> -> []; <> -> BitString = decode_bitstring2(byte_size(Bits), Unused, Bits), decode_bitstring_NNL(BitString, NamedNumberList) end. decode_native_bit_string(Buffer, Tags) -> case match_and_collect(Buffer, Tags) of <<0>> -> <<>>; <> -> Size = bit_size(Bits) - Unused, <> = Bits, Val end. decode_null(Tlv, Tags) -> Val = match_tags(Tlv, Tags), case Val of <<>> -> 'NULL'; _ -> exit({error, {asn1, {decode_null, Val}}}) end. decode_object_identifier(Tlv, Tags) -> Val = match_tags(Tlv, Tags), [AddedObjVal | ObjVals] = dec_subidentifiers(Val, 0, []), {Val1, Val2} = if AddedObjVal < 40 -> {0, AddedObjVal}; AddedObjVal < 80 -> {1, AddedObjVal - 40}; true -> {2, AddedObjVal - 80} end, list_to_tuple([Val1, Val2 | ObjVals]). decode_octet_string(Tlv, TagsIn) -> Bin = match_and_collect(Tlv, TagsIn), binary:copy(Bin). decode_restricted_string(Tlv, TagsIn) -> match_and_collect(Tlv, TagsIn). decode_universal_string(Buffer, Tags) -> Bin = match_and_collect(Buffer, Tags), mk_universal_string(binary_to_list(Bin)). do_encode_named_bit_string([FirstVal | RestVal], NamedBitList, TagIn) -> ToSetPos = get_all_bitposes([FirstVal | RestVal], NamedBitList, []), Size = lists:max(ToSetPos) + 1, BitList = make_and_set_list(Size, ToSetPos, 0), {Len, Unused, OctetList} = encode_bitstring(BitList), encode_tags(TagIn, [Unused | OctetList], Len + 1). e_object_identifier({'OBJECT IDENTIFIER', V}) -> e_object_identifier(V); e_object_identifier(V) when is_tuple(V) -> e_object_identifier(tuple_to_list(V)); e_object_identifier([E1, E2 | Tail]) -> Head = 40 * E1 + E2, {H, Lh} = mk_object_val(Head), {R, Lr} = lists:mapfoldl(fun enc_obj_id_tail/2, 0, Tail), {[H | R], Lh + Lr}. enc_obj_id_tail(H, Len) -> {B, L} = mk_object_val(H), {B, Len + L}. encode_BMP_string(BMPString, TagIn) -> OctetList = mk_BMP_list(BMPString), encode_tags(TagIn, OctetList, length(OctetList)). encode_UTF8_string(UTF8String, TagIn) when is_binary(UTF8String) -> encode_tags(TagIn, UTF8String, byte_size(UTF8String)); encode_UTF8_string(UTF8String, TagIn) -> encode_tags(TagIn, UTF8String, length(UTF8String)). encode_bitstring([B8, B7, B6, B5, B4, B3, B2, B1 | Rest]) -> Val = B8 bsl 7 bor (B7 bsl 6) bor (B6 bsl 5) bor (B5 bsl 4) bor (B4 bsl 3) bor (B3 bsl 2) bor (B2 bsl 1) bor B1, encode_bitstring(Rest, [Val], 1); encode_bitstring(Val) -> {Unused, Octet} = unused_bitlist(Val, 7, 0), {1, Unused, [Octet]}. encode_bitstring([B8, B7, B6, B5, B4, B3, B2, B1 | Rest], Ack, Len) -> Val = B8 bsl 7 bor (B7 bsl 6) bor (B6 bsl 5) bor (B5 bsl 4) bor (B4 bsl 3) bor (B3 bsl 2) bor (B2 bsl 1) bor B1, encode_bitstring(Rest, [Ack, Val], Len + 1); encode_bitstring([], Ack, Len) -> {Len, 0, Ack}; encode_bitstring(Rest, Ack, Len) -> {Unused, Val} = unused_bitlist(Rest, 7, 0), {Len + 1, Unused, [Ack, Val]}. encode_boolean(true, TagIn) -> encode_tags(TagIn, [255], 1); encode_boolean(false, TagIn) -> encode_tags(TagIn, [0], 1); encode_boolean(X, _) -> exit({error, {asn1, {encode_boolean, X}}}). encode_integer(Val) -> Bytes = if Val >= 0 -> encode_integer_pos(Val, []); true -> encode_integer_neg(Val, []) end, {Bytes, length(Bytes)}. encode_integer(Val, NamedNumberList, Tag) when is_atom(Val) -> case lists:keyfind(Val, 1, NamedNumberList) of {_, NewVal} -> encode_tags(Tag, encode_integer(NewVal)); _ -> exit({error, {asn1, {encode_integer_namednumber, Val}}}) end; encode_integer(Val, _NamedNumberList, Tag) -> encode_tags(Tag, encode_integer(Val)). encode_integer(Val, Tag) when is_integer(Val) -> encode_tags(Tag, encode_integer(Val)); encode_integer(Val, _Tag) -> exit({error, {asn1, {encode_integer, Val}}}). encode_integer_neg(- 1, [B1 | _T] = L) when B1 > 127 -> L; encode_integer_neg(N, Acc) -> encode_integer_neg(N bsr 8, [N band 255 | Acc]). encode_integer_pos(0, [B | _Acc] = L) when B < 128 -> L; encode_integer_pos(N, Acc) -> encode_integer_pos(N bsr 8, [N band 255 | Acc]). encode_length(L) when L =< 127 -> {[L], 1}; encode_length(L) -> Oct = minimum_octets(L), Len = length(Oct), if Len =< 126 -> {[128 bor Len | Oct], Len + 1}; true -> exit({error, {asn1, too_long_length_oct, Len}}) end. encode_named_bit_string([H | _] = Bits, NamedBitList, TagIn) when is_atom(H) -> do_encode_named_bit_string(Bits, NamedBitList, TagIn); encode_named_bit_string([{bit, _} | _] = Bits, NamedBitList, TagIn) -> do_encode_named_bit_string(Bits, NamedBitList, TagIn); encode_named_bit_string([], _NamedBitList, TagIn) -> encode_unnamed_bit_string(<<>>, TagIn); encode_named_bit_string(Bits, _NamedBitList, TagIn) when is_bitstring(Bits) -> encode_unnamed_bit_string(Bits, TagIn). encode_null(_Val, TagIn) -> encode_tags(TagIn, [], 0). encode_object_identifier(Val, TagIn) -> encode_tags(TagIn, e_object_identifier(Val)). encode_restricted_string(OctetList, TagIn) when is_binary(OctetList) -> encode_tags(TagIn, OctetList, byte_size(OctetList)); encode_restricted_string(OctetList, TagIn) when is_list(OctetList) -> encode_tags(TagIn, OctetList, length(OctetList)). encode_tags(TagIn, {BytesSoFar, LenSoFar}) -> encode_tags(TagIn, BytesSoFar, LenSoFar). encode_tags([Tag | Trest], BytesSoFar, LenSoFar) -> {Bytes2, L2} = encode_length(LenSoFar), encode_tags(Trest, [Tag, Bytes2 | BytesSoFar], LenSoFar + byte_size(Tag) + L2); encode_tags([], BytesSoFar, LenSoFar) -> {BytesSoFar, LenSoFar}. encode_universal_string(Universal, TagIn) -> OctetList = mk_uni_list(Universal), encode_tags(TagIn, OctetList, length(OctetList)). encode_unnamed_bit_string(Bits, TagIn) -> Unused = (8 - bit_size(Bits) band 7) band 7, Bin = <>, encode_tags(TagIn, Bin, byte_size(Bin)). get_all_bitposes([{bit, ValPos} | Rest], NamedBitList, Ack) -> get_all_bitposes(Rest, NamedBitList, [ValPos | Ack]); get_all_bitposes([Val | Rest], NamedBitList, Ack) when is_atom(Val) -> case lists:keyfind(Val, 1, NamedBitList) of {_ValName, ValPos} -> get_all_bitposes(Rest, NamedBitList, [ValPos | Ack]); _ -> exit({error, {asn1, {bitstring_namedbit, Val}}}) end; get_all_bitposes([], _NamedBitList, Ack) -> lists:sort(Ack). make_and_set_list(0, [], _) -> []; make_and_set_list(0, _, _) -> exit({error, {asn1, bitstring_sizeconstraint}}); make_and_set_list(Len, [XPos | SetPos], XPos) -> [1 | make_and_set_list(Len - 1, SetPos, XPos + 1)]; make_and_set_list(Len, [Pos | SetPos], XPos) -> [0 | make_and_set_list(Len - 1, [Pos | SetPos], XPos + 1)]; make_and_set_list(Len, [], XPos) -> [0 | make_and_set_list(Len - 1, [], XPos + 1)]. match_and_collect(Tlv, TagsIn) -> Val = match_tags(Tlv, TagsIn), case Val of [_ | _] = PartList -> collect_parts(PartList); Bin when is_binary(Bin) -> Bin end. match_tags({T, V}, [T]) -> V; match_tags({T, V}, [T | Tt]) -> match_tags(V, Tt); match_tags([{T, V}], [T | Tt]) -> match_tags(V, Tt); match_tags([{T, _V} | _] = Vlist, [T]) -> Vlist; match_tags(Tlv, []) -> Tlv; match_tags({Tag, _V} = Tlv, [T | _Tt]) -> exit({error, {asn1, {wrong_tag, {{expected, T}, {got, Tag, Tlv}}}}}). minimum_octets(0, Acc) -> Acc; minimum_octets(Val, Acc) -> minimum_octets(Val bsr 8, [Val band 255 | Acc]). minimum_octets(Val) -> minimum_octets(Val, []). mk_BMP_list(In) -> mk_BMP_list(In, []). mk_BMP_list([], List) -> lists:reverse(List); mk_BMP_list([{0, 0, C, D} | T], List) -> mk_BMP_list(T, [D, C | List]); mk_BMP_list([H | T], List) -> mk_BMP_list(T, [H, 0 | List]). mk_BMP_string(In) -> mk_BMP_string(In, []). mk_BMP_string([], US) -> lists:reverse(US); mk_BMP_string([0, B | T], US) -> mk_BMP_string(T, [B | US]); mk_BMP_string([C, D | T], US) -> mk_BMP_string(T, [{0, 0, C, D} | US]). mk_object_val(0, Ack, Len) -> {Ack, Len}; mk_object_val(Val, Ack, Len) -> mk_object_val(Val bsr 7, [Val band 127 bor 128 | Ack], Len + 1). mk_object_val(Val) when Val =< 127 -> {[255 band Val], 1}; mk_object_val(Val) -> mk_object_val(Val bsr 7, [Val band 127], 1). mk_uni_list(In) -> mk_uni_list(In, []). mk_uni_list([], List) -> lists:reverse(List); mk_uni_list([{A, B, C, D} | T], List) -> mk_uni_list(T, [D, C, B, A | List]); mk_uni_list([H | T], List) -> mk_uni_list(T, [H, 0, 0, 0 | List]). mk_universal_string(In) -> mk_universal_string(In, []). mk_universal_string([], Acc) -> lists:reverse(Acc); mk_universal_string([0, 0, 0, D | T], Acc) -> mk_universal_string(T, [D | Acc]); mk_universal_string([A, B, C, D | T], Acc) -> mk_universal_string(T, [{A, B, C, D} | Acc]). number2name(Int, NamedNumberList) -> case lists:keyfind(Int, 2, NamedNumberList) of {NamedVal, _} -> NamedVal; _ -> Int end. unused_bitlist([], Trail, Ack) -> {Trail + 1, Ack}; unused_bitlist([Bit | Rest], Trail, Ack) -> unused_bitlist(Rest, Trail - 1, Bit bsl Trail bor Ack).