# 키 생성

<figure><img src="https://834152021-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGcQ5iayny62s5KuY3VoA%2Fuploads%2F7PkBbKOiqvVIxn1FuggY%2Fkey-gen.png?alt=media&#x26;token=049624aa-f29e-44e3-97af-aaecf6a02dde" alt=""><figcaption></figcaption></figure>

위핀은 인증 프로바이더를 통해서 웹2의 회원가입, 로그인 경험을 바탕으로 지갑을 생성할 수 있습니다. 인증 프로바이더로부터 회원 가입 후, AWS에 접근하여 키 관리를 위한 토큰을 교환한 후 위핀 서버로 키 생성을 요청합니다. 이 때 설정되는 PIN번호는 지갑에서 관리하는 개인키를 암호화 하는데 사용되는 중요한 정보입니다. (PIN 번호는 암호화하여 위핀 서버로 전송되기 때문에 노출되지 않습니다.) 위핀 서버가 지갑 생성 요청을 받으면, AWS KMS에 랜덤 값 생성을 요청하며, 랜던 값을 받아 사용자의 개인키를 생성합니다. 생성된 개인키는 비밀 정보이므로 사용자의 PIN을 기반으로 암호화를 한 후 암호화된 상태로 안전하게 클라우드에 저장됩니다.

키 생성 과정에 실행되는 연산은 신뢰 실행 환경 하에서 실행되기 때문에 위핀 서버에서 접근할 수 없습니다. 랜덤 값으로 키를 생성하고 유도하는 모든 과정은 TEE에서 실행됩니다.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wepin.io/wepin/architecture/keygen.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
