티스토리 뷰

개요 : Apple Push Notification Service(APNS)를 이용하여 특정 iOS Device에 Remote Message를 전달하기 위해서는 Provider Server가 필요하고 상황에 맞는(개발용, 앱스토어 배포용) 인증서가 필요합니다. 본 문서는 Provider Server를 위한 인증서 제작 방법에 대한 내용을 설명합니다.


그림1. Push notifications from multiple providers to multiple devices

(출처 : http://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Art/remote_notif_multiple.jpg)




그림2. Provider-to-Service Connection Trust

(출처 : http://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Art/service_provider_ct.jpg)




인증서 만들기


1. https://developer.apple.com/ -> Member Center -> (Login) -> Certificates, Identifiers & Profiles -> Certificates 로 이동합니다.





2. “+” 버튼을 눌러 원하는 Type을 선택하고 다음으로 이동합니다.

또는




3. APNS를 위한 App ID를 선택하고 다음으로 이동합니다.


4. Keychain(키체인 접근) 을 이용하여 CSR파일 만들기

- 키체인 접근을 실행하고 메뉴 -> 키체인 접근 -> 인증 기관에서 인증서 요청...


- 인증서 정보 입력하고 .certSigningRequest 파일 저장


5. 서버에 .certSigningRequest 파일 올리고 인증서 생성하기




6. 생성된 인증서를 다운로드 받고 실행시키면 키체인 접근에 아래와 같이 인증서가 등록되었음을 볼 수 있습니다.





7. Provider를 위한 .pem 파일 만들기


- 아래와 같이 인증서, 키 를 따로 내보내기 합니다. (인증서는 cert.p12 , 키는 key.p12 로 내보내기 하여 적당한 곳에 저장합니다.)


- 다음은 터미널을 열어 위에서 저장한 .p12 파일 위치로 이동 한 후 아래와 같은 순서로 명령을 실행합니다.

#1> openssl pkcs12 -clcerts -nokeys -out cert.pem -in cert.p12
#2> openssl pkcs12 -nocerts -out key.pem -in key.p12


주의) openssl pkcs12 -nocerts -out key.pem -in key.p12 명령을 실행 후 “Enter PEM pass phrase:  “ 라고 비밀번호를 입력해야 하는데 #3 단계에서 필요하므로 임의로 7자리 이상의 비밀번호를 입력하여 줍니다.


#3> openssl rsa -in key.pem -out key.unencrypted.pem

#4> cat cert.pem key.unencrypted.pem > apns_testapp_development.pem



#1~#4 까지 처리해주는 자동화 스크립트 추가.



make_push_pem.sh



$> Usage: make_push_pem.sh [options] [args]

$> You can get more information: './make_push_pem.sh -h'




* Distribution을 위한 인증서도 위와 같은 방법으로 생성합니다.




공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함