Documentation
¶
Index ¶
- func GetPublicKeyArmorBytes(entity *openpgp.Entity) ([]byte, error)
- func Gets(reader io.Reader) string
- func RSA2048Sign(hash []byte, privateKey *rsa.PrivateKey) ([]byte, error)
- func RSA2048SignBytes(body []byte, privateKey *rsa.PrivateKey) ([]byte, error)
- func RSA2048SignString(body string, privateKey *rsa.PrivateKey) ([]byte, error)
- func RSA2048Verify(hash []byte, sign []byte, publicKey *rsa.PublicKey) error
- func RSA2048VerifyBytes(body []byte, sign []byte, publicKey *rsa.PublicKey) error
- func RSA2048VerifyString(body string, sign []byte, publicKey *rsa.PublicKey) error
- func ReadAndParsePrivateKey(key []byte) (*rsa.PrivateKey, error)
- func ReadAndParsePublicKey(cert []byte) (*rsa.PublicKey, error)
- func ReadPemFile(filename string) ([]byte, error)
- func SHA256Bytes(body []byte) ([]byte, error)
- func SHA256Streams(streams []io.Reader) ([]byte, error)
- func SHA256String(body string) ([]byte, error)
- type CommonPersisOptions
- type DigitalSignPEM
- type JudgeResultPersisOptions
- type ProblemPackageOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RSA2048Sign ¶
func RSA2048Sign(hash []byte, privateKey *rsa.PrivateKey) ([]byte, error)
func RSA2048SignBytes ¶
func RSA2048SignBytes(body []byte, privateKey *rsa.PrivateKey) ([]byte, error)
func RSA2048SignString ¶
func RSA2048SignString(body string, privateKey *rsa.PrivateKey) ([]byte, error)
func RSA2048VerifyBytes ¶
func RSA2048VerifyString ¶
func ReadAndParsePrivateKey ¶
func ReadAndParsePrivateKey(key []byte) (*rsa.PrivateKey, error)
func ReadPemFile ¶
func SHA256Bytes ¶
func SHA256String ¶
Types ¶
type CommonPersisOptions ¶
type CommonPersisOptions struct { DigitalSign bool // 是否启用数字签名 DigitalPEM *DigitalSignPEM // PEM 数字证书 OutFile string // 最终输出文件 }
type DigitalSignPEM ¶
type DigitalSignPEM struct { PublicKey *rsa.PublicKey PrivateKey *rsa.PrivateKey PublicKeyRaw []byte PrivateKeyRaw []byte }
func GetArmorPublicKey ¶
func GetArmorPublicKey(gpgKeyFile string, passphrase []byte) (*DigitalSignPEM, error)
func GetDigitalPEM ¶
func GetDigitalPEM(publicKey []byte, privateKey []byte) *DigitalSignPEM
func GetDigitalPEMFromFile ¶
func GetDigitalPEMFromFile(publicKeyFile string, privateKeyFile string) (*DigitalSignPEM, error)
type JudgeResultPersisOptions ¶
type JudgeResultPersisOptions struct { CommonPersisOptions CompressorType uint8 SessionDir string SaveAcceptedData bool // 是否保存已经AC的数据 }
type ProblemPackageOptions ¶
type ProblemPackageOptions struct { CommonPersisOptions ConfigFile string ConfigDir string }
Click to show internal directories.
Click to hide internal directories.