코드 서명 ID 란 무엇입니까?
XCode에서 "코드 서명 ID"는 무엇입니까?
인증서입니까?
개인 키입니까?
앱 ID입니까?
프로비저닝 프로파일입니까?
대상 빌드 설정으로 이동하면 코드 서명 ID를 요청하므로이를 파악해야합니다.
개인 키를 사용하여 코드에 서명했다고 생각했습니다. 그러나 내 개인 키 이름은 표시되지 않습니다. 인증서 목록을 보여줍니다 (확실하지 않지만).
iOS 애플리케이션의 기기 빌드를 만들려고 할 때 매우 빠르게 깊이 들어가고 골칫거리의 일반적인 원인이되는 주제에 확실히 맞았습니다. 먼저 코드 서명 프로세스와 관련된 각 용어에 대해 약간의 구조를 지정하고 (나중에이 질문에 걸림돌이되는 모든 사람을 위해) 주요 질문으로 넘어갈 수 있습니다.
CodeSign 용어
iOS 기기 빌드의 코드 서명 단계는 애플리케이션 실행 바이너리 자체, 포함 된 미디어 자산 (버튼 텍스처, 사용자 정의 아트 워크, 글꼴 등)을 포함하여 애플리케이션에서 특정 데이터 배열을 암호화하여 서명하고 보호하는 프로세스입니다. ) 및 애플리케이션에 대한 메타 데이터 세트이며 애플리케이션 데이터의 고유 한 '지문'을 나타냅니다. 이 지문은 Apple 및 iOS에서 사용자의 장치로 전달되거나 사용자의 iOS 장치에서 실행될 때 응용 프로그램이 변조되지 않도록하기 위해 사용되는 것입니다. 이를 가능하게하려면 개발자는 Apple에 등록하고, 앱 식별자를 설정하고, 개발 및 배포 인증서를 요청하고, 테스트 장치 세트를 등록하고, 마지막으로 개발 노력을위한 프로비저닝 프로파일을 요청해야합니다.
- 앱 식별자 (또는 AppID)-AppStore에서 정확히 하나의 iOS 애플리케이션을 고유하게 식별하는 역방향 DNS 스타일 문자열입니다.
- 개발 및 배포 인증서 -문서가 발급 된 개인의 신원을 증명하는 Apple에서 암호화 방식으로 서명 한 디지털 문서입니다. 공개 키 인프라에 익숙한 사용자를 위해 인증서 자체에는 나중에 프로세스에서 서명의 무결성을 확인하는 데 사용할 수있는 공개 키가 포함되어 있습니다.
- 테스트 장치 -iOS 소프트웨어에 대해 승인 된 유일한 표준 배포 채널은 AppStore를 통하는 것입니다. 테스트 장치를 등록함으로써 개발자는 AppStore를 우회하고 개발 및 테스트 목적으로 장치에 소프트웨어를 직접 설치할 수 있습니다. 특정 멤버십 연도에 허용되는 총 테스트 장치 수는 100 개의 테스트 장치입니다.
- 프로비저닝 프로필 -1) 정확히 하나의 앱 ID, 2) 하나 이상의 iOS 개발자 인증서, 3) 명명 된 iOS 앱을 직접 설치할 수있는 0 개 이상의 등록 된 테스트 장치의 세 가지 주요 구성 요소가 포함 된 문서입니다. 이 문서의 내용은 내용이 변경되지 않도록 Apple에 의해 암호화 서명되어 있습니다.
이 파일의 존재 여부와 지문은 '누가'(인증서), '무엇을'(AppID), '위치'라는 개념을 포함하므로 개발자 생성 앱을 기기에 설치할 수 있는지 여부를 확인합니다. '(어떤 장치).
좋아요, 알겠습니다 ... 이제이 코드 사인 신원은 어떻습니까?
개별 빌드 대상의 빌드 설정과 관련하여 코드 서명 ID 라는 용어 는 개발자 컴퓨터의 키 체인에 설치된 인증서의 공통 이름을 나타냅니다. Xcode 빌드 설정에서는 개발자가 CodeSign에 사용할 ID를 선택해야하는 옵션 목록으로 나타납니다 .이 메뉴의 각 섹션 에는 많은 정보가 인코딩되어 있습니다.
먼저 검은 색 텍스트를 보면-위 이미지의 'iPhone Developer : Bryan Musial (XXXXXXXXXX)'-이것은 실제로 Xcode가 코드 서명에 사용되는 공개 및 개인 키를 찾는 데 사용하는 주요 항목입니다. 이 항목을 선택하면 Xcode가 키 체인에 도달하여 '공통 이름'필드가 해당 문자열과 일치하는 인증서를 찾은 다음 해당 인증서 (공개 키 포함) 및 해당 인증서에서 사용할 관련 개인 키를 가져 오도록 지시합니다. 코드 사인 작동.
Keychain Access를 열고 'iPhone Development : ...'또는 'iPhone Distribution : ...'인증서를 두 번 클릭하면 Apple이 개발자에게 발급하는 인증서로 인코딩 된 모든 정보가 표시됩니다. 첫 번째 이미지에서 항목을 선택하면 Xcode가 내 키 체인에 도달하여이 인증서를 다시 가져옵니다 (참고 : 고유 식별 세부 정보가 X'd 또는 변경됨).
보시다시피 Xcode 선택의 검은 색 텍스트는 내 인증서의 일반 이름 필드와 정확히 일치하므로 Xcode는 내 앱에 서명하는 코드에서 사용하기 위해이 인증서와 연결된 개인 키를 가져옵니다.
Xcode 설정을 다시 살펴보면 해당 메뉴 선택에 더 많은 텍스트가 있음을 알 수 있습니다. 밝은 회색 텍스트는 애플리케이션에 빌드 될 프로비저닝 프로파일을 식별합니다. 내 예제 설정의 경우 Xcode는 AppID가 'com.myiosapp. *'로 설정된 프로비저닝 프로필 "MyiOSApp Testing"을 가져옵니다. Xcode는 프로비저닝 프로파일을 숨기는 데 매우 탐욕스럽고 다행스럽게도 Organizer는 설치된 프로비저닝 프로파일을 살펴보고 포함 된 기본 데이터에 대해 파악할 수있는 좋은 장소를 제공합니다. 다시 첫 번째 이미지의 Xcode 코드 서명 ID에 대해 내 오거나이저의 관련 프로비저닝 프로파일은 다음과 같습니다.
The 'Name' column and the tail end of the App Identifier column match the light gray text from my Xcode setting so this is the Provisioning Profile that would get selected for use during Code Sign. It is also important to note the 'Status' column at the end of the row. In this case, it is green and indicates 'Valid Profile'. This means that my Keychain has both the Public and Private keys for at least one of the certificates encoded in that Provisioning Profile. If this status is anything other than green then there is a problem with your current setup of Public/Private Keys and/or the Provisioning Profile -- Code Signing can not work unless the Provisioning Profile you are trying to use has its status set to Green. Other possible status options include:
- Valid signing identity not found: You do not have both the Public and Private key for at least one of the Certificates encoded in this Provisioning Profile. Delete the profile from Organizer, then return to the Certificates, Identifiers & Profiles tool on developer.apple.com/ios and ensure you have your Development Certificate included in the Provisioning profile. Verify your certificate in Keychain Access is not expired or revoked and has a private key linked to the public key certificate.
- Profile has expired: The expiry date for the provisioning profile has lapsed. Delete this Provisioning Profile from Organizer, then revisit the Certificates, Identifiers & Profiles tool on developer.apple.com/ios and reissue this Provisioning Profile (if it is actually still needed)
Other items that can trip you up
In addition to all of the nuances about making sure you have both Public and Private keys installed, and that the Provisioning Profiles are set just right, there are a few other things that can trip developers up. First, Xcode collects Provisioning Profiles and hangs on to them until you tell it to delete them. In theory, this isn't a super huge deal except in scenarios where you make changes to a Provisioning Profile, download and install a newer version. Many times Xcode will grab the right profile, but sometimes it doesn't get it right and you'll spend hours looking over the Certificates, Identifiers & Profiles tool as well as your keychain to try and get an idea about what is going on.
Suggestion 1: When installing a newer version of a Provisioning Profile, delete older ones so that Xcode isn't put in a position where it may have to make a decision.
A similar thing can happen if you reissue a Development or Distribution Certificate -- Most times Xcode will trigger a warning during the build about an ambiguous certificate.
Suggestion 2: Pay attention to ambiguity warnings during the build. It implies that you have an old certificate floating around that meets the build criteria and could be inadvertently used potentially causing a build problem.
Suggestion 3: Anytime you are in Keychain dealing with your certificates, look for 'iPhone Developer: ...' or 'iPhone Distribution: ...' certificates that have a red 'X' on them. This is an indicator that the certificate has expired or has been revoked. Either way, this Public Key (and potentially linked Private key) is of no further use to you for build purposes and can be deleted.
Finally, the Code Sign Identity setting also has an option that lists as 'Automatic Profile Selector'. In many cases you will want to use this option as it will do its best to automatically look up your AppID from your build target's settings, look for a Provisioning Profile that matches that AppId and contains certificates that you have both a public and private key for. In some custom build circumstances it may not be possible to use this option and you'll have to use one of the fixed, specific options, like my demonstration setting in the first image. Be advised if you go with a fixed option -- any time you update the Provisioning Profile, you will need to also update the Code Signing Identity build setting to match the newer version.
Key Takeaways
- Make sure you keep both your Keychain and Xcode Provisioning Profile lists clean and deduplicated.
- After installing a Certificate and Provisioning Profile, make sure the Organizer reports that provisioning profile's status as Green ('Valid profile'). Any other status indicates a problem exists between your keychain and provisioning profile that needs to be addressed before you even consider running a build.
- Try and use the 'Automatic Profile Selector'. Your teammates and any automated build systems will be happier with you if they too don't have to think about Code Sign Identity settings.
- If you can't use the Automatic Profile Selector, make sure you always keep that setting up-to-date as newer iterations of your provisioning profile are made.
빌드 구성에 행운을 빕니다. 다른 후속 질문이 있으면 알려주세요!
참조 URL : https://stackoverflow.com/questions/15996468/what-are-code-signing-identities
'developer tip' 카테고리의 다른 글
Android SharedPreferences 모범 사례 (0) | 2021.01.06 |
---|---|
저장 프로 시저의 출력을 SQL Server의 변수로 반환하는 방법 (0) | 2021.01.06 |
C #에서 모든 컨트롤러 및 작업 이름 가져 오기 (0) | 2021.01.05 |
Python : ( "hello"는 "hello")가 True로 평가되는 이유는 무엇입니까? (0) | 2021.01.05 |
현재 선택한 항목을 다시 선택할 때 Android Spinner에서 이벤트를 받으려면 어떻게해야합니까? (0) | 2021.01.05 |