Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update crypto HMAC APIs and refactor code #64

Merged
merged 3 commits into from
Feb 11, 2021

Conversation

ldclakmal
Copy link
Member

Purpose

This PR updates the ballerina/crypto module API for HMAC operations with the return of crypto:Error.

Old APIs:

public isolated function hmacMd5(byte[] input, byte[] key) returns byte[];
public isolated function hmacSha1(byte[] input, byte[] key) returns byte[];
public isolated function hmacSha256(byte[] input, byte[] key) returns byte[];
public isolated function hmacSha384(byte[] input, byte[] key) returns byte[];
public isolated function hmacSha512(byte[] input, byte[] key) returns byte[];

Updated APIs:

public isolated function hmacMd5(byte[] input, byte[] key) returns byte[]|Error;
public isolated function hmacSha1(byte[] input, byte[] key) returns byte[]|Error;
public isolated function hmacSha256(byte[] input, byte[] key) returns byte[]|Error;
public isolated function hmacSha384(byte[] input, byte[] key) returns byte[]|Error;
public isolated function hmacSha512(byte[] input, byte[] key) returns byte[]|Error;

Fixes: ballerina-platform/ballerina-library#908
Related to: ballerina-platform/ballerina-library#584

@ldclakmal ldclakmal merged commit 1440ac4 into ballerina-platform:master Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update and refactor ballerina/crypto module APIs
2 participants