PS c:\src\flutter_project> flutter pub add --dev msix
PS c:\src\flutter_project> flutter pub run msix:create
PC证书生成
cert.ps1
set-executionpolicy remotesigned
$cert = New-SelfSignedCertificate -DnsName www.xxx.com -CertStoreLocation cert:\LocalMachine\My
$pwd = ConvertTo-SecureString -String "xxx" -Force -AsPlainText
Export-PfxCertificate -Cert $cert -FilePath xx_cert.pfx -Password $pwd
New-SelfSignedCertificate
- CN 公用名称(Common Name) 简称:CN 字段,对于 SSL 证书,一般为网站域名;而对于代码签名证书则为申请单位名称;而对于客户端证书则为证书申请者的姓名
- O 单位名称 (Organization Name) 简称:O 字段,对于 SSL 证书,一般为网站域名;而对于代码签名证书则为申请单位名称;而对于客户端单位证书则为证书申请者所在单位名称
- C 字段,只能是国家字母缩写,如中国:CN
- -KeyUsage DigitalSignature 指定证书的密钥使用扩展名中设置的密钥使用, DigitalSignature 数字证书
- -FriendlyNam 证书的友好名称, 在mmc 控制台 证书中可以看见
- -CertStoreLocation 指定存储新证书的证书位置, Cert:\CurrentUser\My 当前用户
- -TextExtension 指定一系列证书扩展名, 后面的值基本固定
- -NotAfter (Get-Date).AddYears(10) 证书在10年内到期
ConvertTo-SecureString
- -String 123456 设置密码
Export-PfxCertificate
- -cert "Cert:\CurrentUser\My\BA167F5AF3984064891DD8E70030F8B1175ABFF1" 这个是Thumbprint值 BA167F5AF3984064891DD8E70030F8B1175ABFF1
- -FilePath 保存证书路径