Rodhos Soft

備忘録を兼ねた技術的なメモです。Rofhos SoftではiOSアプリ開発を中心としてAndroid, Webサービス等の開発を承っております。まずはご相談下さい。

キーチェーンサービスプログラミングガイド

developer.apple.com

冒頭

Computer users typically have to manage multiple accounts that require logins with user IDs and passwords.

コンピュータのユーザは通常はユーザIDとパスワードをつかったログイン要求のある多数のアカウントを管理する必要があります。

Secure FTP servers, AppleShare servers, database servers, secure websites, instant messaging accounts, and many other services require authentication before they can be used.

セキュアーなFTPサービス、Appleシェアサービス、データベースサービス、セキュアなウェブサービス、インスタントメッセージのアカウントのような多くのサービスは使用可能になる前に認証が要求されます。

Users often respond to this situation by making up very simple, easily remembered passwords, by using the same password over and over, or by writing passwords down where they can be easily found.

ユーザはその状況でしばしば、非常に単純で覚えやすいパスワードを作ったり、同一のパスワードを繰り返し使ったり、簡単に見つけられるとこにパスワードを書いたりしてこれに対処します。

Any of these cases compromises security.

これらのケースはいずれもセキュリティを低下させます。

Note

Note: On iPhone, Keychain rights depend on the provisioning profile used to sign your application.

iPhoneでは、キーチェーンの権限はアプリケーションにサインに使われるプロビジョニングプロファイルに依存します。

Be sure to consistently use the same provisioning profile across different versions of your application.

アプリケーションの異なるバージョンのそれぞれで同一のプロビジョニングプロファイルを一貫して用いているか気をつけてください。

第2パラグラフ

From the user’s point of view, a keychain provides transparent authentication; that is, (after unlocking the keychain if in OS X) the user does not have to log in separately to any services whose passwords are stored in the keychain.

ユーザーの観点から、キーチェーンは透過的な認証を提供しています。つまり、(OS Xなら、キーチェーンをアンロックした後に) ユーザは任意のサービスでそのサービスのパスワードがキーチェーンに登録されていればそれらを別々に書いておく必要がありません。

In OS X, the user has only to enter one password once to access any number of applications, servers, websites, and so on.

OS Xにおいてはユーザは唯一1パスワードのみ、アプリケーション、サービス、ウェブサイト等のどんな数でもアクセスするのに1パスワードを一度入力するのみで良いのです。

In iOS, the user need not even enter the keychain password.

iOSにおいて、ユーザはキーチェーンパスワードを入力する必要さえありません。

Figure 1-1 shows the relationship between the user, the keychain, and the password-protected services.

図1-1はユーザ、キーチェーンとパスワードでプロテクトされたサービスとの関係を示しています。

For iOS the first step (unlocking the keychain) is omitted.

iOSに対しては最初のステップ(キーチェーンのアンロック)はありません。

In iOS, an application can always access its own keychain items, but not items created by any other application.

iOSにおいては、アプリケーションはつねに自分自身のキーチェーンアイテムにアクセスすることができます。しかし、他のアプリによって生成されたアイテムはアクセスできません。

Note

Note: In addition to passwords, keychains can store cryptographic keys, certificates, and (in OS X) text strings (notes).

パスワードに加えて、キーチェーンは暗号鍵、証明書、そして文字列(OS Xではnotes)もストアできる。

Notes are generally entered by the user with the Keychain Access utility.

Notesは一般的にユーザがキーチェーン・ユーティリティを用いて入力されます。

Most applications that use Keychain Services need to store or retrieve passwords, and that is the subject of this document.

キーチェーン・サービスを使うほとんどのアプリケーションはパスワードをストアし、取り出すことを必要としており、それがこのドキュメントの主題です。

If you need to store or retrieve keys or certificates, see Certificate, Key, and Trust Services Reference.

もし、キーあるいは証明書をストアする必要があるなら、Certificate, Key, and Trust Services Referenceを参照してください。

第3パラグラフ

By default, in OS X each login account has one keychain (for a new login on OS X v10.3, this keychain is named login.keychain); however, a user or application can create as many keychains as desired.

デフォルトで、OS Xにおいてはそれぞれのログインアカウントは一つのキーチェーンを持っています(OSX v10.3上の新しいログインに対しては、このキーチェーンはloigin.keychainと名付けられています。)。しかし、ユーザもしくはアプリケーションは欲しいだけの多くのキーチェーンを生成することができます。

The login keychain is automatically unlocked during login if it has the same password as the user’s login account password.

もしユーザのログインアカウントパスワードとして同一のパスワードを持っているなら、ログインキーチェーンはログインされている間に自動的にアンロックされます、

When first created, the login keychain is also the default keychain.

最初に作られた時、ログインキーチェーンはまたデフォルトのキーチェーンでもあります。

The default keychain is used to store newly created keychain items unless a different keychain is specified in the function call; certain other Keychain Services functions also use the default keychain when no other keychain is specified.

ファンクションコールで他のキーチェーンで明治しない限りデフォルトのキーチェーンは新しく生成されたキーチェーンアイテムをストアすることに使われます。

The user can use the Keychain Access utility to designate another keychain as the default; however, the login keychain doesn’t change.

ユーザは他のキーチェーンをデフォルトと指定するのにキーチェーンアクセスユーティリティを使うことができます。しかしながらログインキーチェーンを変えることはできません。

In iOS, the situation is simpler: There is a single keychain accessible to applications.

iOSでは状況はもっと簡単です。唯一個のキーチェーンがアプリケーションにアクセス可能です。

Although it stores the keychain items of all the applications on the system, an application can access only its own keychain items (with the possible exception of a keychain item for which the application that created it obtained a persistent reference).

システムのすべてのアプリケーションのキーチェーンアイテムをストアするが、アプリケーションは自分自身のキーチェーンのアイテムのみアクセスできる(キーチェーンの可能な例外を伴う。アイテムに対しアプリケーションが永続的参照を得るようなものを生成する場合)

Keychain Services and CDSA

Structure of a Keychain

Keychain Access Controls

Keeping Your OS X Keychain Data Secure