Skip to content

Commit

Permalink
chore: update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Sashwat-K committed May 13, 2024
1 parent aeea55f commit da643d6
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ This function decrypts encrypted attestation records.

```go
import "github.com/Sashwat-K/lib-hpcr/attestation"

func main() {
decryptedAttestationRecords, err := HpcrGetAttestationRecords(encryptedChecksum, privateKey)
}
```

#### Input(s)
Expand All @@ -30,6 +34,10 @@ This function downloads HPCR encryption certificates from IBM Cloud.

```go
import "github.com/Sashwat-K/lib-hpcr/certificate"

func main() {
certs, err := HpcrDownloadEncryptionCertificates(sampleEncryptionCertVersionsList)
}
```

#### Input(s)
Expand All @@ -44,6 +52,10 @@ This function returns encryption certificate and version from HpcrDownloadEncryp

```go
import "github.com/Sashwat-K/lib-hpcr/certificate"

func main() {
version, cert, err := HpcrGetEncryptionCertificateFromJson(sampleJsonData, desiredVersion)
}
```

#### Input(s)
Expand All @@ -60,6 +72,10 @@ This function generates Base64 for given string.

```go
import "github.com/Sashwat-K/lib-hpcr/contract"

func main() {
base64, sha256, err := HpcrText(sampleStringData)
}
```

#### Input(s)
Expand All @@ -75,6 +91,10 @@ This function encrypts text and formats text as per `hyper-protect-basic.<encode

```go
import "github.com/Sashwat-K/lib-hpcr/contract"

func main() {
encryptedText, sha256, err := HpcrTextEncrypted(sampleStringData, encryptionCertificate)
}
```

#### Input(s)
Expand All @@ -91,6 +111,10 @@ This function generates Base64 of JSON input

```go
import "github.com/Sashwat-K/lib-hpcr/contract"

func main() {
base64, sha256, err := HpcrJson(sampleStringJson)
}
```

#### Input(s)
Expand All @@ -106,6 +130,10 @@ This function generates encrypts JSON and formats text as per `hyper-protect-bas

```go
import "github.com/Sashwat-K/lib-hpcr/contract"

func main() {
encryptedJson, sha256, err := HpcrJsonEncrypted(sampleStringJson, encryptionCertificate)
}
```

#### Input(s)
Expand All @@ -122,6 +150,10 @@ This function generates base64 of TGZ that contains files under the given folder

```go
import "github.com/Sashwat-K/lib-hpcr/contract"

func main() {
encodedTgz, err := HpcrTgz(composePath)
}
```

#### Input(s)
Expand All @@ -134,6 +166,14 @@ import "github.com/Sashwat-K/lib-hpcr/contract"
### HpcrTgzEncrypted()
This function first generates base64 of TGZ that contains files under the given folder and then encrypts the data as per `hyper-protect-basic.<encoded-encrypted-password>.<encoded-encrypted-data>`.

```go
import "github.com/Sashwat-K/lib-hpcr/contract"

func main() {
encodedTgz, err := HpcrTgzEncrypted(composePath, encryptionCertificate)
}
```

#### Input(s)
1. Path of folder

Expand All @@ -146,6 +186,10 @@ This function generates a signed and encrypted contract with format `hyper-prote

```go
import "github.com/Sashwat-K/lib-hpcr/contract"

func main() {
signedEncryptedContract, err := HpcrContractSignedEncrypted(contract, encryptionCertificate, privateKey)
}
```

#### Input(s)
Expand All @@ -162,6 +206,24 @@ This function generates a signed and encrypted contract with contract expiry ena

```go
import "github.com/Sashwat-K/lib-hpcr/contract"

func usingCsrParams() {
sampleCeCSRPems = map[string]interface{}{
"country": "IN",
"state": "Karnataka",
"location": "Bangalore",
"org": "IBM",
"unit": "ISDL",
"domain": "HPVS",
"mail": "[email protected]",
}

signedEncryptedCEContract, err := HpcrContractSignedEncryptedContractExpiry(contract, encryptionCertificate, privateKey, caCert, caKey, string(csrParams), "", sampleContractExpiryDays)
}

func usingCsrPem() {
signedEncryptedCEContract, err := HpcrContractSignedEncryptedContractExpiry(contract, encryptionCertificate, privateKey, caCert, caKey, "", csr, sampleContractExpiryDays)
}
```

#### Input(s)
Expand Down Expand Up @@ -197,6 +259,10 @@ This function selects the latest HPCR image details from image list out from IBM

```go
import "github.com/Sashwat-K/lib-hpcr/image"

func main() {
imageId, imageName, imageChecksum, ImageVersion, err := HpcrSelectImage(imageJsonList, version)
}
```

#### Input(s)
Expand Down

0 comments on commit da643d6

Please sign in to comment.