성태의 닷넷 이야기
홈 주인
모아 놓은 자료
프로그래밍
질문/답변
사용자 관리
사용자
메뉴
아티클
외부 아티클
유용한 코드
온라인 기능
MathJax 입력기
최근 덧글
[정성태] Working with Rust Libraries from C#...
[정성태] Detecting blocking calls using asyn...
[정성태] 아쉽게도, 커뮤니티는 아니고 개인 블로그입니다. ^^
[정성태] 질문이 잘 이해가 안 됩니다. 우선, 해당 소스코드에서 ILis...
[양승조
] var대신 dinamic으로 선언해서 해결은 했습니다. 맞는 해...
[양승조
] 또 막혔습니다. ㅠㅠ var list = props[i].Ge...
[양승조
] 아. 감사합니다. 어제는 안됐던것 같은데....정신을 차려야겠네...
[정성태] "props[i].GetValue(props[i])" 코드에서 ...
[정성태] 저렇게 조각 코드 말고, 실제로 재현이 되는 예제 프로젝트를 압...
[정성태] Modules 창(Ctrl+Shift+U)을 띄워서, 해당 Op...
글쓰기
제목
이름
암호
전자우편
HTML
홈페이지
유형
제니퍼 .NET
닷넷
COM 개체 관련
스크립트
VC++
VS.NET IDE
Windows
Team Foundation Server
디버깅 기술
오류 유형
개발 환경 구성
웹
기타
Linux
Java
DDK
Math
Phone
Graphics
사물인터넷
부모글 보이기/감추기
내용
<div style='display: inline'> <h1 style='font-family: Malgun Gothic, Consolas; font-size: 20pt; color: #006699; text-align: center; font-weight: bold'>SHA256 테스트 인증서 생성 방법</h1> <p> Visual Studio의 C# 프로젝트 설정 창에서 테스트 인증서를 생성하면 SHA1 해시만 지원합니다. 만약, 해당 인증서를 SHA256으로 만들고 싶다면 PowerShell을 이용해,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > New-SelfSignedCertificate ; <a target='tab' href='https://learn.microsoft.com/en-us/powershell/module/pkiclient/new-selfsignedcertificate'>https://learn.microsoft.com/en-us/powershell/module/pkiclient/new-selfsignedcertificate</a> </pre> <br /> 관리자 권한으로 다음과 같이 실행해 주면 됩니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > PS C:\temp> <span style='color: blue; font-weight: bold'>New-SelfSignedCertificate -DnsName "MyCert"</span> PSParentPath: Microsoft.PowerShell.Security\Certificate::LocalMachine\MY Thumbprint Subject ---------- ------- CC699DC2F035A5580ECC0E638E0626EC537905B1 CN=MyCert </pre> <br /> 생성된 인증서는 "인증서 관리자(certlm, certmgr)"로 확인하면 Current User와 Local Computer 영역에 등록되어 총 3군데 위치하게 됩니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > Certificates - Current User \Intermediate Certification Authorities \ Certificates Certificates - Local Computer \Personal \ Certificates \Intermediate Certification Authorities \ Certificates </pre> <br /> 아울러 속성을 보면, 아래와 같이 SHA256으로 되어 있고!<br /> <br /> <img alt='sha256_self_cert_1.png' src='/SysWebRes/bbs/sha256_self_cert_1.png' /><br /> <br /> <hr style='width: 50%' /><br /> <br /> 위의 명령어는 원래 다음과 같이 CertStoreLocation을 준 것과 동일한 효과를 갖습니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > New-SelfSignedCertificate -DnsName "MyCert" <span style='color: blue; font-weight: bold'>-CertStoreLocation "cert:\LocalMachine\My"</span> </pre> <br /> 반면 위치를 CurrentUser로 명시하면,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > New-SelfSignedCertificate -DnsName "MyCert" <span style='color: blue; font-weight: bold'>-CertStoreLocation "cert:\CurrentUser\My"</span> </pre> <br /> 이번에는 다음의 경로에만 등록되어 2개가 생성됩니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > Certificates - Current User \Personal \ Certificates \Intermediate Certification Authorities \ Certificates </pre> <br /> 단독 테스트 인증서와 함께 루트를 갖는 테스트 인증서도 가능한데,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > New-SelfSignedCertificate -DnsName "MyCert" -CertStoreLocation "cert:\CurrentUser\My" <span style='color: blue; font-weight: bold'>-TestRoot</span> </pre> <br /> 이럴 때는, "CertReq Test Root"가 루트 인증서가 되고 그 하위에 "MyCert"가 위치합니다.<br /> <br /> 또한, FriendlyName이나 DnsName도 지정할 수 있고.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > New-SelfSignedCertificate <span style='color: blue; font-weight: bold'>-DnsName "www.testsite.co.kr"</span> -CertStoreLocation "cert:\CurrentUser\My" <span style='color: blue; font-weight: bold'>-FriendlyName "TestCert"</span> </pre> <br /> 이렇게 생성된 테스트 인증서는 비주얼 스튜디오의 프로젝트 속성 창에서 제공하는 서명 용 인증서로 사용할 수 없습니다. 왜냐하면, 인증서의 용도가 "Client Authentication"과 "Server Authentication"으로 기본 지정되기 때문입니다. 따라서 그런 경우에는 명시적으로 "CodeSigning" 옵션을 명시해야 합니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > New-SelfSignedCertificate -DnsName "www.testsite.co.kr" <span style='color: blue; font-weight: bold'>-Type CodeSigning</span> -CertStoreLocation "cert:\CurrentUser\My" -FriendlyName "TestCert" </pre> <br /> <hr style='width: 50%' /><br /> <br /> 참고로 다음의 글은 makecert를 이용하는 방법을 설명합니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > How to Create Certificate and SHA-256 XML Signatures? ; <a target='tab' href='https://learnfreecoding.com/how-to-create-certificate-and-sha-256-xml-signatures/'>https://learnfreecoding.com/how-to-create-certificate-and-sha-256-xml-signatures/</a> </pre> </p><br /> <br /><hr /><span style='color: Maroon'>[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]</span> </div>
첨부파일
스팸 방지용 인증 번호
1883
(왼쪽의 숫자를 입력해야 합니다.)