Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andreas-mausch/026413d908ba61cda15981bb4fbcd276 to your computer and use it in GitHub Desktop.
Save andreas-mausch/026413d908ba61cda15981bb4fbcd276 to your computer and use it in GitHub Desktop.
Generate certificates on CLI without installing the full Tizen Studio
# Get access token here:
# https://account.samsung.com/accounts/TDC/signInGate?clientId=4fb7fnf3np&tokenType=TOKEN
# Find the CA certificates here:
# https://gitlab.com/andreas-mausch/moonwatch/-/tree/master/certificates
# Author certificate
openssl genrsa -out author.key.pem 2048
openssl rsa -in author.key.pem -outform PEM -pubout -out author.key.pem.pub
openssl req -new -key author.key.pem -out author.csr -subj "/[email protected]"
curl -v -X POST https://dev.tizen.samsung.com:443/apis/v2/authors -F access_token=<ACCESS_TOKEN> -F user_id=<USER_ID> -F [email protected] --output author.crt
cat author.crt ca/gear_test_author_CA.cer > author-and-ca.crt
openssl pkcs12 -export -out author.p12 -inkey author.key.pem -in author-and-ca.crt -name usercertificate
# Distributor certificate
openssl genrsa -out distributor.key.pem 2048
openssl rsa -in distributor.key.pem -outform PEM -pubout -out distributor.key.pem.pub
openssl req -new -key distributor.key.pem -out distributor.csr -subj "/CN=TizenSDK" -addext "subjectAltName = URI:URN:tizen:packageid=,URI:URN:tizen:deviceid=<DEVICE_ID>"
curl -v -X POST https://dev.tizen.samsung.com:443/apis/v2/distributors -F access_token=<ACCESS_TOKEN> -F user_id=<USER_ID> -F privilege_level=Public -F developer_type=Individual -F [email protected] --output distributor.crt
cat distributor.crt ca/samsung_tizen_dev_public2.crt > distributor-and-ca.crt
openssl pkcs12 -export -out distributor.p12 -inkey distributor.key.pem -in distributor-and-ca.crt -name usercertificate
@testuser7
Copy link

testuser7 commented Nov 16, 2024

They changed clientId in URL to get access token to: v285zxnl3h.
Additionally, the -legacy option must be used with openssl pkcs12 commands to use certificates with the SDK.

@testuser7
Copy link

Generating certificates for TV (VD) looks a bit different:

# Author certificate VD
openssl req -new -key author.key.pem -out author.csr -subj "/CN=<EMAIL_OR_NAME>"
curl -v -X POST https://dev.tizen.samsung.com:443/apis/v2/authors -F access_token=<ACCESS_TOKEN> -F user_id=<USER_ID> -F platform=VD -F [email protected] --output author.crt
cat author.crt ca/vd_tizen_dev_author_ca.cer > author-and-ca.crt
openssl pkcs12 -export -out author.p12 -inkey author.key.pem -in author-and-ca.crt -name usercertificate -legacy

# Distributor certificate VD
openssl req -new -key distributor.key.pem -out distributor.csr -subj "/CN=TizenSDK/emailAddress=<EMAIL>" -addext "subjectAltName = URI:URN:tizen:packageid=,URI:URN:tizen:deviceid=<DEVICE_ID>"
curl -v -X POST https://dev.tizen.samsung.com:443/apis/v2/distributors -F access_token=<ACCESS_TOKEN> -F user_id=<USER_ID> -F platform=VD -F privilege_level=Public -F developer_type=Individual -F [email protected] --output distributor.crt
cat distributor.crt ca/vd_tizen_dev_public2.crt > distributor-and-ca.crt
openssl pkcs12 -export -out distributor.p12 -inkey distributor.key.pem -in distributor-and-ca.crt -name usercertificate -legacy

@sreyemnayr
Copy link

I've created an app to do this work for us! Thanks for all of the research!
https://github.com/sreyemnayr/tizencertificates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment