DEENESPTFRRUARHIKOZHNL

모듈 ara::crypto — Cryptography

Spezifikation: AUTOSAR_AP_SWS_Cryptography.pdf (R25-11) · 387 API-Records

모듈 가이드AI 생성

애플리케이션을 위해 격리된 암호화 작업, 키 관리 및 X.509 인증서 서비스를 제공합니다.
AI 생성 미검증 모델: gemini-3.8-flash-medium · 노력: medium · 온도: 제어 불가 · 프롬프트: b84ff51de547 출처 열린 질문 (1)
인과 앵커: R25-11 R25-11부터 유효 이 사양 릴리스용으로 새로 합성되었습니다.
독일어 가이드에서 번역됨gemini-3.8-flash-low · 2026-10-13 · 독일어 원문

애플리케이션을 위해 격리된 암호화 작업, 키 관리 및 X.509 인증서 서비스를 제공합니다.

기능 클러스터 Cryptography는 대칭 및 비대칭 암호화, 서명 검증, 안전한 키 및 인증서 관리를 위한 표준화된 보안 서비스를 제공합니다(PlatformDesign 71쪽). 암호화 작업 및 영속적 키 슬롯에 대한 접근은 플랫폼별 프로바이더와 매니페스트에 선언적으로 고정된 인스턴스 지정자를 통해 엄격하게 격리되어 이루어집니다(SWS Cryptography 39쪽). 이때 사용 제한을 강제함으로써 민감한 키 자료의 유출을 방지합니다([SWS_CRYPT_50092]).

기능 클러스터 Cryptography(ara::crypto)는 AUTOSAR Adaptive Platform을 위한 포괄적인 보안 아키텍처를 제공합니다(PlatformDesign 71쪽). 손상된 사용자 애플리케이션으로부터 보호하기 위해 키 보관 및 암호화 실행은 일반적으로 격리된 플랫폼 데몬 또는 하드웨어 보안 모듈(HSM)에 캡슐화됩니다(AUTOSAR AP EXP SWArchitecture 97쪽, SWS Cryptography 87쪽). 전체 기능은 연산 프리미티브를 위한 특화된 CryptoProvider, 영속적 키 슬롯(KeySlots)을 위한 키 스토리지 영역, 그리고 PKI 인증서 관리를 위한 머신 전역의 X509Provider(으)로 구분됩니다(SWS Cryptography 39쪽).

diag_crypto_arch App Adaptive Application Daemon Cryptography Daemon (ara::crypto) App->Daemon IPC / C++ API CryptoProvider CryptoProvider (HSM / Driver / Software) Daemon->CryptoProvider Primitive Execution KeyStorage Key Storage Provider (KeySlots) Daemon->KeyStorage Key Lifecycle X509Prov X.509 Provider (Certificates / CRL) Daemon->X509Prov PKI Services KeyStorage->CryptoProvider Key Deployment

컨텍스트 다이어그램: 애플리케이션, 데몬 및 프로바이더 간의 Functional Cluster Cryptography 아키텍처 및 컴포넌트 관계. 출처: SWS Cryptography 39쪽, PlatformDesign 71쪽, AUTOSAR AP EXP SWArchitecture 97쪽.

애플리케이션은 자신의 프로바이더(AUTOSAR AP EXP SWArchitecture 99쪽)를 통해 대칭 암호([SWS_CRYPT_20742]), 인증된 암호([SWS_CRYPT_20745]), 해시 함수([SWS_CRYPT_20747]) 또는 서명자 및 검증자 인스턴스([SWS_CRYPT_20756], [SWS_CRYPT_20757])와 같은 암호화 컨텍스트를 생성합니다. 처리는 결정론적 수명 주기를 따릅니다. 키 바인딩(SetKey) 후 변환이 Start()을(를) 통해 시작되고, Update()을(를) 통해 스트리밍되며, Finish()(으)로 완료됩니다(AUTOSAR AP TR SystemTests 206쪽, EXP SWArchitecture 104쪽). 변경 불가능한 AllowedUsageFlags은(는) 무단 키 사용을 효과적으로 방지합니다([SWS_CRYPT_50092], AUTOSAR AP TR SystemTests 177쪽).

diag_context_state Uninit Uninitialized Ready Ready (Key Deployed) Uninit->Ready SetKey() Ready->Uninit Reset() Streaming Processing (Started / Update) Ready->Streaming Start() Streaming->Uninit Cancel() / Reset() Streaming->Streaming Update() / UpdateConfidentialData() Finished Finished / Digest Available Streaming->Finished Finish() / FinishEncrypt() Finished->Uninit Reset() Finished->Ready Start() (Re-use)

상태 다이어그램: 할당부터 리셋까지 암호화 변환 컨텍스트의 수명 주기. 출처: [SWS_CRYPT_20742], [SWS_CRYPT_23911], [SWS_CRYPT_23625], [SWS_CRYPT_50046], [SWS_CRYPT_50212].

인증서 및 CSR은 X509Provider을(를) 통해 관리되는 반면([SWS_CRYPT_40099], [SWS_CRYPT_40640]), 유효성 검사 컨텍스트는 CRL 취소 목록([SWS_CRYPT_50183]) 및 OCSP 응답([SWS_CRYPT_50124])을 고려하여 인증서 체인을 검사합니다(AUTOSAR AP TR SystemTests 194쪽). 애플리케이션에 대한 KeySlots 및 인증서의 할당은 매니페스트에서 InstanceSpecifier을(를) 통해 모델 기반으로 이루어집니다(AUTOSAR AP TPS ManifestSpecification 245쪽, AUTOSAR AP TPS ManifestSpecification 649쪽). 모든 인터페이스는 예외 없는 ara::core::Result 반환값으로 동작하며 CryptoErrorDomain을(를) 통해 오류를 알립니다([SWS_CRYPT_19902], SWS Cryptography 208쪽).

아키텍처, 보안 도메인 및 데몬 격리

기능 클러스터 Cryptography(ara::crypto)는 AUTOSAR Adaptive Platform의 핵심 보안 기반을 형성하며 암호화 기본 메커니즘, 키 관리 및 인증서 서비스를 제공합니다(PlatformDesign 71쪽). 플랫폼의 신뢰 모델에 따르면 기능 플랫폼 클러스터는 신뢰할 수 있는 기반에 속하는 반면, Adaptive Applications는 비특권 사용자 공간에서 실행됩니다(SWS Cryptography 37쪽). 애플리케이션의 잠재적 침해 시에도 키 자료와 암호화 작업을 효과적으로 보호하기 위해 아키텍처는 일반적으로 데몬 기반으로 설계되며, 실제 실행 및 키 보관은 격리된 플랫폼 프로세스 또는 보안 실행 환경 내에 유지됩니다(AUTOSAR AP EXP SWArchitecture 97쪽, SWS Cryptography 87쪽).

아키텍처는 암호화 기능을 세 가지 주요 도메인으로 나눕니다: 연산 프리미티브 및 키 변환을 위한 CryptoProvider, 영속적 객체 보관을 위한 키 스토리지 영역(ara::crypto::keys), 그리고 인증서 관리를 위한 X509Provider(ara::crypto::x509)입니다(SWS Cryptography 39쪽, SWS Cryptography 87쪽). 하나의 제어기에서 서로 다른 하드웨어 보안 모듈(HSM, TPM) 또는 소프트웨어 기반 드라이버를 연결하기 위해 여러 개의 특화된 CryptoProvider 인스턴스가 병렬로 존재할 수 있습니다(SWS Cryptography 39쪽). 그러나 서로 다른 프로바이더 간에는 의도적으로 상호 운용성이 존재하지 않습니다. 하나의 암호화 객체 또는 키는 정확히 하나의 프로바이더에 속하며 다른 프로바이더에 의해 처리될 수 없습니다(SWS Cryptography 39쪽). 이러한 엄격한 캡슐화는 주로 하드웨어 보안 도메인이 자체 키 경계를 물리적으로 강제하며 키 핸들이 도메인 간에 유효하지 않다는 사실에 기인한 것으로 보입니다. 질문 Q-63efe107cf111983 (열림)

diag_crypto_arch App Adaptive Application Daemon Cryptography Daemon (ara::crypto) App->Daemon IPC / C++ API CryptoProvider CryptoProvider (HSM / Driver / Software) Daemon->CryptoProvider Primitive Execution KeyStorage Key Storage Provider (KeySlots) Daemon->KeyStorage Key Lifecycle X509Prov X.509 Provider (Certificates / CRL) Daemon->X509Prov PKI Services KeyStorage->CryptoProvider Key Deployment

컨텍스트 다이어그램: 애플리케이션, 데몬 및 프로바이더 간의 Functional Cluster Cryptography 아키텍처 및 컴포넌트 관계. 출처: SWS Cryptography 39쪽, PlatformDesign 71쪽, AUTOSAR AP EXP SWArchitecture 97쪽.

암호화 프로바이더의 진입점 및 초기화

모듈로의 진입은 중앙 추상화 인터페이스를 위한 팩토리 역할을 하는 전역 진입 함수들을 통해 이루어집니다(SWArchitecture 71쪽). 애플리케이션은 모델링된 ara::core::InstanceSpecifier을(를) 지정하여 함수 [SWS_CRYPT_20099]을(를) 통해 CryptoProvider의 인스턴스를 생성하거나 로드합니다. 인증서 관리의 경우 전체 시스템에 정확히 하나의 전역 인증서 프로바이더가 존재하며, 이는 [SWS_CRYPT_40099]을(를) 통해 로드됩니다(SWS Cryptography 39쪽). 아울러 [SWS_CRYPT_30098]을(를) 통한 직접적인 난수 데이터 생성 및 [SWS_CRYPT_20098]을(를) 통한 하드웨어 지원 보안 카운터 조회를 포함한 전역 헬퍼 서비스를 사용할 수 있습니다(SWArchitecture 71쪽).

영속적 키 리소스는 직접 인스턴스화되지 않고 논리적 키 슬롯(KeySlots)을 통해 로드됩니다. 이를 위해 런타임 환경은 읽기 전용 접근을 위한 함수 [SWS_CRYPT_50004] 및 쓰기 가능한 키 슬롯을 위한 함수 [SWS_CRYPT_50005]을(를) 제공하며, 이 함수들은 전달된 인스턴스 식별자를 권한 구성에 대해 유효성 검사합니다(SWS Cryptography 87쪽, AUTOSAR AP TPS ManifestSpecification 649쪽). 획득한 KeySlot 인스턴스를 통해 연결된 프로바이더 인스턴스를 [SWS_CRYPT_30403](으)로 쿼리할 수 있으며, 이를 통해 저장 위치와 실행 환경 간의 긴밀한 바인딩이 보장됩니다(SWS Cryptography 39쪽).

CryptoProvider 인스턴스를 사용할 수 있게 되면, 이는 특정 암호화 작업 컨텍스트를 인스턴스화하기 위한 중앙 팩토리 역할을 합니다(AUTOSAR AP EXP SWArchitecture 99쪽). 생성 가능한 컨텍스트에는 난수 생성기용 컨텍스트([SWS_CRYPT_20741]), 대칭 블록 및 스트림 암호용 컨텍스트([SWS_CRYPT_20742]), 인증된 암호화용 컨텍스트([SWS_CRYPT_20745]), 메시지 인증 코드용 컨텍스트([SWS_CRYPT_20746]), 암호화 해시 함수용 컨텍스트([SWS_CRYPT_20747]), 비대칭 암호화 및 복호화용 컨텍스트([SWS_CRYPT_20750], [SWS_CRYPT_20751]), 그리고 서명 및 검증 컨텍스트([SWS_CRYPT_20756], [SWS_CRYPT_20757]) 등이 포함됩니다(EXP SWArchitecture 99쪽).

암호화 변환 컨텍스트 및 데이터 처리

ara::crypto에서의 암호화 데이터 처리는 알고리즘 구성, 키 바인딩 및 스트리밍 처리의 분리를 보장하는 엄격한 상태 기반 수명 주기를 따릅니다(AUTOSAR AP TR SystemTests 211쪽). 공급자를 통해 컨텍스트를 할당한 후, 해당 컨텍스트는 처음에 초기화되지 않음 상태에 있습니다. 대칭 키([SWS_CRYPT_23911]), 개인 키([SWS_CRYPT_23515]) 또는 KeySlot에서 직접 가져오는 것([SWS_CRYPT_50043])과 같이 SetKey()의 타입별 오버로드를 통해 호환 가능한 키를 전달해야만 컨텍스트가 준비 완료 상태로 전환됩니다(AUTOSAR AP TR SystemTests 206쪽).

스트리밍 처리의 경우 변환은 Start()에 의해 개시되며, 선택적으로 초기화 벡터 또는 컨텍스트를 전달할 수 있습니다([SWS_CRYPT_22110], [SWS_CRYPT_23625], [SWS_CRYPT_50020]). 이후 데이터 블록은 Update()을(를) 통해 단계적으로 공급될 수 있습니다([SWS_CRYPT_21113], [SWS_CRYPT_22113], [SWS_CRYPT_50139]). 인증된 암호화(AEAD)에서 인터페이스는 [SWS_CRYPT_20313]을(를) 통해 처리되는 연관 데이터와 [SWS_CRYPT_50074]을(를) 통한 기밀 페이로드를 엄격하게 분리합니다(EXP SWArchitecture 104쪽). 변환의 완료는 Finish() 또는 FinishEncrypt()을(를) 통해 수행되며([SWS_CRYPT_21115], [SWS_CRYPT_23618], [SWS_CRYPT_50075]), 그 후 인증 태그 또는 체크섬을 GetDigest()을(를) 통해 판독할 수 있습니다([SWS_CRYPT_21116], [SWS_CRYPT_22116]).

스트리밍 모드 외에도 대칭 암호 및 인증된 암호와 같은 컨텍스트 클래스는 [SWS_CRYPT_50047] 또는 [SWS_CRYPT_50078]을(를) 통한 컴팩트한 일회성 호출을 지원하므로, 다단계 프로토콜 호출 없이도 짧은 페이로드를 효율적으로 암호화 또는 복호화할 수 있습니다(SWS Cryptography 58쪽). 진행 중인 작업을 중단해야 하는 경우, Cancel()([SWS_CRYPT_50023], [SWS_CRYPT_50046]) 또는 Reset()([SWS_CRYPT_50212])의 호출이 컨텍스트를 정리된 초기 상태로 결정론적으로 되돌립니다(EXP SWArchitecture 100쪽).

diag_context_state Uninit Uninitialized Ready Ready (Key Deployed) Uninit->Ready SetKey() Ready->Uninit Reset() Streaming Processing (Started / Update) Ready->Streaming Start() Streaming->Uninit Cancel() / Reset() Streaming->Streaming Update() / UpdateConfidentialData() Finished Finished / Digest Available Streaming->Finished Finish() / FinishEncrypt() Finished->Uninit Reset() Finished->Ready Start() (Re-use)

상태 다이어그램: 할당부터 리셋까지 암호화 변환 컨텍스트의 수명 주기. 출처: [SWS_CRYPT_20742], [SWS_CRYPT_23911], [SWS_CRYPT_23625], [SWS_CRYPT_50046], [SWS_CRYPT_50212].

키 관리, 캡슐화 및 권한 강제

암호화 키는 객체 모델에서 CryptoObject 또는 RestrictedUseObject로 타입화됩니다(AUTOSAR AP EXP SWArchitecture 111쪽, EXP SWArchitecture 111쪽). 플랫폼 표준은 대칭 키(SymmetricKey), 비대칭 개인 키(PrivateKey), 공개 키(PublicKey)를 구분합니다(SWS Cryptography 291쪽). 키 구성요소는 CryptoProvider를 통해 직접 생성하거나([SWS_CRYPT_20721], [SWS_CRYPT_20722]), KeyDerivationFunctionCtx([SWS_CRYPT_20748])를 기본 키로 매개변수화하고 [SWS_CRYPT_21515]를 통해 실행하여 기존 키 구성요소로부터 유도할 수 있습니다(EXP SWArchitecture 108쪽).

최소 권한의 원칙을 적용하기 위해 각 키 객체는 [SWS_CRYPT_50092]을 통해 쿼리할 수 있는 불변의 사용 제약 조건(AllowedUsageFlags)을 가집니다(AUTOSAR AP TR SystemTests 177쪽). 암호화 스택은 매 바인딩 시도(SetKey) 시 대상 컨텍스트의 연산(예: 암호화, 서명, 유도 또는 내보내기)이 키의 플래그에 의해 승인되었는지 검증하며, 허용되지 않는 사용을 엄격히 거부합니다(AUTOSAR AP TR SystemTests 177쪽, SWArchitecture 95쪽). 알고리즘의 기본 할당은 [SWS_CRYPT_20955]을 통해 확인할 수 있습니다.

안전한 키 교환을 위해 모듈은 여러 표준화된 절차를 구현합니다: 비대칭 키 합의(Diffie-Hellman / ECDH)에서는 [SWS_CRYPT_20758]를 통해 개인 키가 바인딩되는 KeyAgreementPrivateCtx를 생성하며([SWS_CRYPT_21313]), 그 후 [SWS_CRYPT_21312] 메서드가 상대방의 공개 키를 포함하여 공통 대칭 대상 키를 계산합니다(AUTOSAR AP TR SystemTests 179쪽). Key Encapsulation Mechanism(KEM)에서는 KeyEncapsulatorPublicCtx([SWS_CRYPT_20752])가 [SWS_CRYPT_21813]를 사용하여 대칭 키를 캡슐화하는 반면, 상대방은 [SWS_CRYPT_21412]를 통해 KeyDecapsulatorPrivateCtx([SWS_CRYPT_20753])로 역캡슐화를 수행합니다(AUTOSAR AP TR SystemTests 173쪽, AUTOSAR TR AdaptivePlatformSystemTests 188쪽). 보호된 키 전송을 위해 Key Wrapping([SWS_CRYPT_24014], [SWS_CRYPT_24016]) 및 보안 내보내기([SWS_CRYPT_20728])가 제공됩니다(AUTOSAR AP TR SystemTests 174쪽, AUTOSAR AP TR SystemTests 182쪽).

비대칭 키 합의(ECDH) 및 대칭 파생App (CRYPTOApp01)CryptoProviderKeyAgreementPrivateCtxSymmetricKeyCreateKeyAgreementPrivateCtx(algId)Result<KeyAgreementPrivateCtx::Sptr>SetKey(privKey)Result<void>AgreeKey(otherSidePublicKey, targetAlgId, allowedUsage)대칭 키 객체 생성Result<SymmetricKey::Sptr>

시퀀스 다이어그램: Diffie-Hellman을 통한 비대칭 키 합의 및 대칭 페이로드 키 유도. 출처: [SWS_CRYPT_20758], [SWS_CRYPT_21313], [SWS_CRYPT_21312], AUTOSAR AP TR SystemTests 179쪽.

비대칭 서명은 분리된 컨텍스트를 통해 처리됩니다: 서명은 SignerPrivateCtx([SWS_CRYPT_20756]) 및 [SWS_CRYPT_23512] 메서드를 통해 수행되는 반면, 검증은 VerifierPublicCtx([SWS_CRYPT_20757]) 및 [SWS_CRYPT_24112] 메서드를 통해 수행됩니다(AUTOSAR AP TR SystemTests 164쪽, SWArchitecture 84쪽). 특권 관리 서비스(예: OTA 키 롤오버)에 의해 백그라운드에서 KeySlot이 업데이트되는 경우, 소비 라이브러리는 키 구성요소를 동기적으로 다시 로드하기 위해 [SWS_CRYPT_30404]를 통해 업데이트 옵저버로부터 알림을 받을 수 있습니다(AUTOSAR AP SWS Cryptography 36쪽).

SignerPrivateCtx 및 VerifierPublicCtx를 통한 서명 생성 및 검증ApplikationCryptoProviderSignerPrivateCtxVerifierPublicCtxCreateSignerPrivateCtx(algId)Result<SignerPrivateCtx::Sptr>SetKey(privKey)Result<void>Sign(message, signatureBuffer, format)Result<std::size_t> (서명 크기)Use Case: 서명 검증CreateVerifierPublicCtx(algId)Result<VerifierPublicCtx::Sptr>SetKey(pubKey)Result<void>Verify(message, signature, format)Result<bool> (유효 / 유효하지 않음)

시퀀스 다이어그램: 분리된 개인 및 공개 컨텍스트를 사용한 서명 생성 및 검증 절차. 출처: [SWS_CRYPT_20756], [SWS_CRYPT_23515], [SWS_CRYPT_23512], [SWS_CRYPT_20757], [SWS_CRYPT_24115], [SWS_CRYPT_24112], AUTOSAR AP TR SystemTests 164쪽.

X.509 인증서 관리, 유효성 검증 및 그룹

ara::crypto::x509 서브시스템은 공개 키 인프라(PKI)를 위한 표준화된 기능을 제공합니다(EXP SWArchitecture 116쪽). 중앙의 X509Provider([SWS_CRYPT_40099])는 휘발성 세션 스토리지뿐만 아니라 영속적 저장소도 지원합니다(SWS Cryptography 39쪽). 인증서 및 체인은 [SWS_CRYPT_40614] 또는 [SWS_CRYPT_40616]를 통해 바이트 버퍼에서 파싱됩니다. 새로운 식별 인증서를 요청하기 위해 애플리케이션은 [SWS_CRYPT_40640]를 통해 암호화 서명된 Certificate Signing Request(CSR)를 생성할 수 있으며, 이때 서명자 컨텍스트와 Distinguished Name(DN)은 [SWS_CRYPT_50186]를 통해 전달됩니다(AUTOSAR AP TR SystemTests 189쪽).

적합성 및 유효성 검사를 위해 애플리케이션은 [SWS_CRYPT_50125]를 통해 CertificateValidationCtx를 인스턴스화합니다. 이 컨텍스트에는 [SWS_CRYPT_50117]를 통해 트러스트 앵커(Trust Anchor)가 추가되고, [SWS_CRYPT_50120]를 통해 검증 옵션이 정의되며, [SWS_CRYPT_50121]를 통해 기준 타임스탬프가 지정됩니다. 신뢰 체인에 대한 계층적 체인 검사는 [SWS_CRYPT_50122] 또는 [SWS_CRYPT_50123]를 통해 수행됩니다(AUTOSAR AP TR SystemTests 194쪽). 인증서 폐기를 확인하기 위해 인증서 폐기 목록(CRL)을 가져오거나([SWS_CRYPT_50183]), [SWS_CRYPT_40626], [SWS_CRYPT_50185] 및 [SWS_CRYPT_50124]을 통해 온라인 인증서 상태 쿼리(RFC 6960에 따른 OCSP)를 검증 상태에 통합할 수 있습니다(AUTOSAR AP TR SystemTests 194쪽).

키 갱신 시 인증서 소비자를 개별 인증서 인스턴스로부터 분리하기 위해 매니페스트는 CryptoCertificateGroup 개념을 지원합니다(AUTOSAR AP TPS ManifestSpecification 657쪽). 소비 애플리케이션은 [SWS_CRYPT_50126]를 통해 논리적으로 연결된 전체 인증서 그룹을 로드하며, 권한이 있는 관리 서비스는 [SWS_CRYPT_50127] 및 [SWS_CRYPT_50128]를 통해 인증서를 동적으로 교체하거나 정리할 수 있습니다(AUTOSAR AP TPS ManifestSpecification 657쪽).

인증서 체인, CRL 및 OCSP를 사용한 X.509 인증서 유효성 검증ApplikationX509ProviderValidationCtxCreateCertificateValidationCtx()Result<CertificateValidationCtx::Sptr>AddTrustedCertificate(rootCert)Result<void>ImportCrl(instanceSpecifier, crlBytes, format)Result<CertificateValidationStatus>AddOcspResponse(ocspResponse, issuerCert)Result<CertificateValidationStatus>ValidateCertificate(targetCert)Result<CertificateValidationResult::Sptrc>

시퀀스 다이어그램: 인증서 체인, CRL 가져오기 및 온라인 OCSP 상태 확인을 포함한 X.509 인증서 유효성 검증. 출처: [SWS_CRYPT_40099], [SWS_CRYPT_50125], [SWS_CRYPT_50122], [SWS_CRYPT_50183], [SWS_CRYPT_50124], AUTOSAR AP TR SystemTests 194쪽.

매니페스트 모델링, 포트 인터페이스 및 배포

전체 차량 아키텍처로의 암호화 리소스 통합은 ARXML 매니페스트의 AUTOSAR 메타모델을 통해 선언적으로 이루어집니다(AUTOSAR AP TPS ManifestSpecification 244쪽). 소프트웨어 컴포넌트는 설계 수준에서 CryptoInterface의 특수화로 타입화되는 포트(RPortPrototype)를 통해 보안 요구사항을 모델링합니다: 키 슬롯용 CryptoKeySlotInterface, 인증서 리소스용 CryptoCertificateInterface, 실행 제공자 액세스용 CryptoProviderInterface(TPS ManifestSpecification 167쪽, AUTOSAR AP TPS ManifestSpecification 245쪽). 인터페이스의 속성은 읽기 또는 쓰기 권한 부여 여부(writeAccess) 및 허용되는 객체 유형(TPS ManifestSpecification 168쪽, TPS ManifestSpecification 438쪽)을 불변으로 정의합니다.

배포 매니페스트에서 대상 구성(Target Configuration)은 추상 포트 프로토타입을 구체적인 물리적 플랫폼 리소스에 연결합니다(AUTOSAR AP TPS ManifestSpecification 649쪽). 메타모델 요소 CryptoKeySlotToPortPrototypeMapping은 프로세스의 포트를 머신의 CryptoModuleInstantiation에 선언된 CryptoKeySlot에 매핑합니다(TPS ManifestSpecification 614쪽, TPS ManifestSpecification 646쪽). 유사한 방식으로 CryptoCertificateToPortPrototypeMapping은 인증서를 할당합니다(TPS ManifestSpecification 655쪽). 런타임에 매니페스트 내 포트의 경로는 애플리케이션 코드가 [SWS_CRYPT_50004]와 같은 로드 함수에 전달하는 ara::core::InstanceSpecifier를 나타냅니다(ManifestSpecification 154쪽).

기능 클러스터 간의 플랫폼 상호 작용(예: Communication Management(SecOC, IPsec, TLS)와 암호화 스택 간)에는 기존의 포트 프로토타입이 존재하지 않습니다(TPS ManifestSpecification 861쪽). 여기서 InstanceSpecifier은 대신 FunctionalClusterInteractsWithFunctionalClusterMapping에서 파생된 요소(예: ComKeyToCryptoKeySlotMapping 또는 SecOcJobMapping)로 구성됩니다(TPS ManifestSpecification 861쪽, TPS ManifestSpecification 864쪽, ManifestSpecification 411쪽). 영속성 보호(Persistency Deployment) 및 소프트웨어 클러스터 체크섬 또한 이러한 표준화된 매니페스트 매핑을 통해 키와 제공자를 바인딩합니다(TPS ManifestSpecification 867쪽, TPS ManifestSpecification 896쪽).

오류가 발생한 경우의 동작

암호화 모듈의 오류 처리 개념은 내결함성 및 예외 없는 코드에 대한 Adaptive Platform의 엄격한 요구사항을 따릅니다(noexcept)(SWS Cryptography 145쪽). 모든 동기 연산은 일반 결과 유형인 ara::core::Result<T, ara::core::ErrorCode>를 통해 오류 상황을 반환합니다(SWS Cryptography 208쪽). 오류 코드는 [SWS_CRYPT_19902]로 표시되는 자체 오류 도메인에 고정되어 있으며, 해당 이름은 [SWS_CRYPT_19950]를 통해, 텍스트 오류 설명은 [SWS_CRYPT_19953]을 통해 쿼리할 수 있습니다. 예외 처리를 명시적으로 사용하는 애플리케이션을 위해 스택은 예외 유형 CryptoException([SWS_CRYPT_19906]) 및 도우미 함수 [SWS_CRYPT_19954]를 제공합니다.

일반적인 기능 오류 코드에는 SetKey() 호출 전에 암호화 연산이 시작된 경우의 CryptoErrc::kUninitializedContext이나, 전달된 입력 데이터 버퍼가 필요한 블록 그리드와 일치하지 않는 경우의 CryptoErrc::kInvalidInputSize와 같은 컨텍스트 위반이 포함됩니다(SWS Cryptography 208쪽). 직렬화 및 변환 작업 중에는 지원되지 않는 인수 값에 대해 CryptoErrc::kUnknownIdentifier가, 호환되지 않는 매개변수 조합에 대해 CryptoErrc::kIncompatibleArguments가 신호를 보냅니다(SWS Cryptography 145쪽). 키 리소스에 액세스할 때 스택은 kAccessViolation을 반환하여 무단 액세스를 방지합니다(SWS Cryptography 87쪽). 잘못된 사용자 정의 X.509 인증서 확장을 파싱할 때 파서는 CryptoErrc::kRuntimeFault와 함께 중단됩니다(SWS Cryptography 280쪽, SWS Cryptography 356쪽).

오류가 발생한 후 컨텍스트에서 정의된 상태를 복원하고 데몬에서 메모리 누수 또는 멈춘 스트리밍 버퍼를 방지하려면 호출자가 컨텍스트를 정리해야 합니다. 이는 미완료된 변환을 폐기하는 Cancel()를 명시적으로 호출하거나([SWS_CRYPT_50046], [SWS_CRYPT_50089]), 컨텍스트를 키 바인딩 전의 상태로 완전히 되돌리는 Reset()([SWS_CRYPT_50212])를 호출하여 수행됩니다(EXP SWArchitecture 100쪽).

더 자세한 증거

Cryptography 모듈의 사양은 아래에 분류된 일련의 핵심 요구사항 및 아키텍처 문서를 기반으로 합니다:

이 모듈 가이드는 AUTOSAR Adaptive 사양 R25-11을 기반으로 AI 큐레이션 어시스턴트에 의해 작성되었습니다.

function: 261 type alias: 43 variable: 43 class: 34 enumeration: 5 struct: 1

주제 맵

상세 보기

개요에서 항목을 선택하세요.

ara::crypto

Crypto Error Domain class that provides interfaces as defined by ara::core::ErrorDomain such as a name of the Crypto Error Domain or message

상속 대상 ara::core::ErrorDomain

CryptoException 클래스

Exception type thrown for CRYPTO errors.

상속 대상 ara::core::Exception

Formatter 클래스

Formatter object interface.

SecureCounter 클래스

128 bit secure counter made up of two uint64_t’s representing the most significant and least significant bits

Serializable 클래스

Serializable object interface.

Return a reference to the global CryptoErrorDomain.

constexpr const ara::core::ErrorDomain & GetCryptoErrorDomain () noexcept;

This factory method shall create or return the existing instance of a specific Crypto Provider.

ara::core::Result< cryp::CryptoProvider::Sptr > LoadCryptoProvider (const ara::core::InstanceSpecifier &iSpecify) noexcept;

Factory that creates a Formatter.

ara::core::Result< Formatter::Sptr > LoadFormatter () noexcept;

Load a read-only key slot. This factory method shall load the information associated with the specified KeySlot into a KeySlot object.

ara::core::Result< cryp::KeySlot::Sptr > LoadKeySlot (const ara::core::InstanceSpecifier &iSpecify) noexcept;

Load a writeable key slot. This factory method shall load the information associated with the specified KeySlot into a WriteableKeySlot object.

ara::core::Result< cryp::WriteableKeySlot::Sptr > LoadWriteableKeySlot (const ara::core::InstanceSpecifier &iSpecify) noexcept;

This factory method shall create or return the existing instance of the singleton X.509 Provider.

ara::core::Result< x509::X509Provider::Sptr > LoadX509Provider () noexcept;

Makes Error Code instances from the Crypto Error Domain. The returned ErrorCode instance always references to CryptoErrorDomain.

constexpr ara::core::ErrorCode MakeErrorCode (CryptoErrorDomain::Errc code, ara::core::ErrorDomain::SupportDataType data) noexcept;
CryptoErrc 열거형

Defines the error codes for the ara::crypto::CryptoErrorDomain

enum class CryptoErrc : ara::core::ErrorDomain::CodeType {...};

Enumeration of all types of crypto objects, i.e. types of content that can be stored to a key slot.

enum class CryptoObjectType : std::uint8_t {...};
CryptoTransform 열거형

Enumeration of cryptographic transformation directions.

enum class CryptoTransform : std::uint8_t {...};
AlgId 타입 별칭

Type for holding StringView of algorithm according to standardized format described in the chapter ’Naming Convention’.

using AlgId = ara::core::StringView;
AlgIdString 타입 별칭

Type for holding String of algorithm according to standardized format described in the chapter ’Naming Convention’.

using AlgIdString = ara::core::String;
AllowedUsageFlags 타입 별칭

Type for holding bit-flags of allowed usages of a key.

using AllowedUsageFlags = std::uint32_t;
FormatId 타입 별칭

A container type for the encoding format identifiers.

using FormatId = std::uint32_t;
LoadCryptoProvider 타입 별칭

Type for holding StringView of algorithm according to standardized format described in the chapter ’Naming Convention’.

ReadOnlyMemRegion 타입 별칭

Read-Only Memory Region (intended for [in] arguments)

using ReadOnlyMemRegion = ara::core::Span<const std::uint8_t>;
ReadWriteMemRegion 타입 별칭

Read-Write Memory Region (intended for [out] or [in/out] arguments)

using ReadWriteMemRegion = ara::core::Span<std::uint8_t>;
Timestamp 타입 별칭

The key can be used for data decryption.

constexpr AllowedUsageFlags kAllowDataDecryption {0x0002};

The following constants define 1-bit values representing allowed usages. The key can be used for data encryption

constexpr AllowedUsageFlags kAllowDataEncryption {0x0001};

The derived key can be exported in plaintext.

constexpr AllowedUsageFlags kAllowDerivedPlaintextExport {0x4000};

The key can be used as input to a HashFunctionCtx.

constexpr AllowedUsageFlags kAllowHashCalculation {0x1000};

The key can be used as private or public input to key agreement.

constexpr AllowedUsageFlags kAllowKeyAgreement {0x0020};

The key can be used for key derivation.

constexpr AllowedUsageFlags kAllowKeyDerivation {0x0040};

The key can be used as a key encryption key for key unwrapping or key decapsulation.

constexpr AllowedUsageFlags kAllowKeyUnwrapping {0x0100};

The key can be used as a key encryption key for key wrapping or key encapsulation.

constexpr AllowedUsageFlags kAllowKeyWrapping {0x0080};
kAllowMac 변수

The key can be used for MAC generation and verification.

constexpr AllowedUsageFlags kAllowMac {0x0004};

The key can persisted.

constexpr AllowedUsageFlags kAllowPersist {0x0200};

The key can be exported in plaintext.

constexpr AllowedUsageFlags kAllowPlaintextExport {0x2000};

The symmetric key can be used for seeding of a RandomGeneratorCtx.

constexpr AllowedUsageFlags kAllowRngInit {0x0800};

The key can be securely exported (protected export)

constexpr AllowedUsageFlags kAllowSecuredExport {0x0400};

The key can be used for signature generation.

constexpr AllowedUsageFlags kAllowSigGeneration {0x0008};

The key can be used for signature verification.

constexpr AllowedUsageFlags kAllowSigVerification {0x0010};

Export DER-encoded value of an object.

constexpr FormatId kFormatDerEncoded {2};

Export PEM-encoded value of an object.

constexpr FormatId kFormatPemEncoded {3};

Export only raw value of an object, i.e., a plain byte array for symmetric keys and ISO/IEC 7816-8 / IEEE P1363 encoding for combined values.

constexpr FormatId kFormatRawValueOnly {1};

Proprietary format that is only valid in the context of a CryptoProvider.

constexpr FormatId kProprietaryFormat {0};

ara::crypto::cryp

AuthCipherCtx 클래스

Authenticated Cipher Context interface.

상속 대상 CryptoContext

CryptoObject 클래스

A common interface for all cryptographic objects recognizable by the Crypto Provider.

상속 대상 ara::crypto::Serializable

기반 클래스 대상 PrivateKey, PublicKey, SymmetricKey

CryptoProvider 클래스

CryptoProviderInterface representing one implementation of a set of cryptographic primitives with a key storage.

Interface for asymmetric decryption.

상속 대상 CryptoContext

Interface for asymmetric encryption.

상속 대상 CryptoContext

HashFunctionCtx 클래스

Hash function interface.

상속 대상 CryptoContext

Key Agreement Private key Context interface.

상속 대상 CryptoContext

Asymmetric Key Encapsulation Mechanism (KEM) Private key Context interface.

상속 대상 CryptoContext

Key Derivation Function interface.

상속 대상 CryptoContext

Asymmetric Key Encapsulation Mechanism (KEM) Public key Context interface.

상속 대상 CryptoContext

KeySlot 클래스

KeySlot interface representing a storage location for a key in a CryptoProvider.

기반 클래스 대상 WriteableKeySlot

Keyed Message Authentication Code Context interface definition.

상속 대상 CryptoContext

PrivateKey 클래스

Generalized Asymmetric Private Key interface.

상속 대상 CryptoObject

A contexts for importing secured data such as secret key-material.

상속 대상 CryptoContext

PublicKey 클래스

General Asymmetric Public Key interface.

상속 대상 CryptoObject

Interface of Random Number Generator Context.

상속 대상 CryptoContext

Signature Private key Context interface.

상속 대상 CryptoContext

Interface for Symmetric Cipher Operations.

상속 대상 CryptoContext

SymmetricKey 클래스

Symmetric Key interface.

상속 대상 CryptoObject

Context of a symmetric key wrap algorithm.

상속 대상 CryptoContext

Signature Verification Public key Context interface.

상속 대상 CryptoContext

WriteableKeySlot interface representing a writeable storage location for a key in a Crypto Provider.

상속 대상 KeySlot

ara::crypto::x509

Certificate 클래스

X.509 Certificate interface.

상속 대상 ara::crypto::Serializable

Certificate Validation Context.

X.509 Certificate Validation Result.

CertSignRequest 클래스

Certificate Signing Request (CSR) object interface.

상속 대상 ara::crypto::Serializable

OcspResponse 클래스

Interface of OcspResponse.

X509DN 클래스

Interface of X.509 Distinguished Name (DN).

상속 대상 ara::crypto::Serializable

X509Provider 클래스

X.509 Provider interface.

Certificate Validation Status.

enum class CertificateValidationStatus : std::uint8_t {...};

On-line Certificate Status Protocol (OCSP) Response Status.

enum class OcspResponseStatus : std::uint8_t {...};

Type for holding bit-flags of certificate validation options.

using CertificateValidationOptions = std::uint32_t;
X509ExtendedKeyUsage 타입 별칭

X.509 v3 Extended Key Usage type definition.

using X509ExtendedKeyUsage = std::uint32_t;
X509KeyUsage 타입 별칭

X.509 v3 Key Usage type definition.

using X509KeyUsage = std::uint32_t;

TLS WWW client authentication.

constexpr X509ExtendedKeyUsage kClientAuth {0x4000};

Signing of downloadable executable code.

constexpr X509ExtendedKeyUsage kCodeSigning {0x2000};

The key can be used for Certificates Revokation Lists (CRL) signing.

constexpr X509KeyUsage kConstrCrlSign {0x0200};

The key can be used for data encipherment.

constexpr X509KeyUsage kConstrDataEncipherment {0x1000};

The enciphermet key can be used for deciphering only.

constexpr X509KeyUsage kConstrDecipherOnly {0x0080};

The key can be used for digital signature production.

constexpr X509KeyUsage kConstrDigitalSignature {0x8000};

The enciphermet key can be used for enciphering only.

constexpr X509KeyUsage kConstrEncipherOnly {0x0100};

The key can be used for a key agreement protocol execution.

constexpr X509KeyUsage kConstrKeyAgreement {0x0800};

The key can be used for certificates signing.

constexpr X509KeyUsage kConstrKeyCertSign {0x0400};

The key can be used for key encipherment.

constexpr X509KeyUsage kConstrKeyEncipherment {0x2000};

The key can be used in cases requiring the "non-repudiation" guarantee.

constexpr X509KeyUsage kConstrNonRepudiation {0x4000};

Email protection.

constexpr X509ExtendedKeyUsage kEmailProtection {0x1000};
kIgnoreCrl 변수

ignore previously imported CRLs

constexpr CertificateValidationOptions kIgnoreCrl {0x0008};

ignore the NotAfter field

constexpr CertificateValidationOptions kIgnoreNotAfter {0x0002};

ignore the NotBefore field

constexpr CertificateValidationOptions kIgnoreNotBefore {0x0001};

ignore all unknown critical extensions

constexpr CertificateValidationOptions kIgnoreUnknownCritical Extensions {0x0004};
kOcspOff 변수

do not require OCSP response during certificate validation. This is the default behavior.

constexpr CertificateValidationOptions kOcspOff {0x0040};

require OCSP response for all certificates of chain

constexpr CertificateValidationOptions kOcspResponseCompleteChain {0x0010};

require OCSP response only for target certificate

constexpr CertificateValidationOptions kOcspResponseTargetOnly {0x0020};

Signing OCSP responses.

constexpr X509ExtendedKeyUsage kOCSPSigning {0x0400};

TLS WWW server authentication.

constexpr X509ExtendedKeyUsage kServerAuth {0x8000};

Binding the hash of an object to a time.

constexpr X509ExtendedKeyUsage kTimeStamping {0x0800};

네임스페이스

모듈의 UML 클래스 다이어그램

Abgerundete Rahmen = Namespaces; hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); graue Boxen = modulfremde bzw. externe Basisklassen. Klicken öffnet die Klassenseite.

G cluster_1 ara::crypto cluster_2 ara::crypto::cryp cluster_3 ara::crypto::x509 nara__crypto__Serializable855 Serializable nara__crypto__CryptoErrorDomain690 CryptoErrorDomain nara__core__ErrorDomain335 ara::core::ErrorDomain nara__crypto__CryptoErrorDomain690->nara__core__ErrorDomain335 nara__crypto__CryptoException764 CryptoException nara__core__Exception792 ara::core::Exception nara__crypto__CryptoException764->nara__core__Exception792 nara__crypto__Formatter631 Formatter nara__crypto__SecureCounter126 «struct» SecureCounter nara__crypto__cryp__AuthCipherCtx142 AuthCipherCtx nara__crypto__cryp__CryptoContext85 CryptoContext nara__crypto__cryp__AuthCipherCtx142->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__CryptoObject679 CryptoObject nara__crypto__cryp__CryptoObject679->nara__crypto__Serializable855 nara__crypto__cryp__DecryptorPrivateCtx616 DecryptorPrivateCtx nara__crypto__cryp__DecryptorPrivateCtx616->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__EncryptorPublicCtx829 EncryptorPublicCtx nara__crypto__cryp__EncryptorPublicCtx829->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__HashFunctionCtx412 HashFunctionCtx nara__crypto__cryp__HashFunctionCtx412->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__KeyAgreementPrivateCtx203 KeyAgreementPrivateCtx nara__crypto__cryp__KeyAgreementPrivateCtx203->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__KeyDecapsulatorPrivateCtx748 KeyDecapsulatorPrivateCtx nara__crypto__cryp__KeyDecapsulatorPrivateCtx748->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__KeyDerivationFunctionCtx485 KeyDerivationFunctionCtx nara__crypto__cryp__KeyDerivationFunctionCtx485->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__KeyEncapsulatorPublicCtx699 KeyEncapsulatorPublicCtx nara__crypto__cryp__KeyEncapsulatorPublicCtx699->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__KeySlot637 KeySlot nara__crypto__cryp__MessageAuthnCodeCtx845 MessageAuthnCodeCtx nara__crypto__cryp__MessageAuthnCodeCtx845->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__PrivateKey762 PrivateKey nara__crypto__cryp__PrivateKey762->nara__crypto__cryp__CryptoObject679 nara__crypto__cryp__ProtectedKeyImportCtx279 ProtectedKeyImportCtx nara__crypto__cryp__ProtectedKeyImportCtx279->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__PublicKey940 PublicKey nara__crypto__cryp__PublicKey940->nara__crypto__cryp__CryptoObject679 nara__crypto__cryp__RandomGeneratorCtx512 RandomGeneratorCtx nara__crypto__cryp__RandomGeneratorCtx512->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__SignerPrivateCtx943 SignerPrivateCtx nara__crypto__cryp__SignerPrivateCtx943->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__SymmetricCipherCtx167 SymmetricCipherCtx nara__crypto__cryp__SymmetricCipherCtx167->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__SymmetricKey111 SymmetricKey nara__crypto__cryp__SymmetricKey111->nara__crypto__cryp__CryptoObject679 nara__crypto__cryp__SymmetricKeyWrapperCtx465 SymmetricKeyWrapperCtx nara__crypto__cryp__SymmetricKeyWrapperCtx465->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__VerifierPublicCtx35 VerifierPublicCtx nara__crypto__cryp__VerifierPublicCtx35->nara__crypto__cryp__CryptoContext85 nara__crypto__cryp__WriteableKeySlot529 WriteableKeySlot nara__crypto__cryp__WriteableKeySlot529->nara__crypto__cryp__KeySlot637 nara__crypto__cryp__CryptoProvider844 CryptoProvider nara__crypto__x509__Certificate240 Certificate nara__crypto__x509__Certificate240->nara__crypto__Serializable855 nara__crypto__x509__CertSignRequest934 CertSignRequest nara__crypto__x509__CertSignRequest934->nara__crypto__Serializable855 nara__crypto__x509__X509DN930 X509DN nara__crypto__x509__X509DN930->nara__crypto__Serializable855 nara__crypto__x509__CertificateValidationCtx565 CertificateValidationCtx nara__crypto__x509__CertificateValidationResult372 CertificateValidationResult nara__crypto__x509__OcspResponse358 OcspResponse nara__crypto__x509__X509Provider937 X509Provider