Skip to content

Commit

Permalink
Remove unnecessary code segments
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuvindu committed Oct 4, 2023
1 parent 984abe6 commit e5a872e
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions ballerina/modules/wssec/encryption.bal
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,7 @@ class Encryption {
returns byte[]|Error {
byte[] data = dataString.toBytes();
do {
match encryptionAlgorithm {
RSA_ECB => {
return check crypto:encryptRsaEcb(data, key);
}
_ => {
return error Error("Invalid/Missing key!");
}
}
return check crypto:encryptRsaEcb(data, key);
} on fail var e {
return error(e.message());
}
Expand All @@ -46,14 +39,7 @@ class Encryption {
crypto:PublicKey|crypto:PrivateKey key)
returns byte[]|Error {
do {
match encryptionAlgorithm {
RSA_ECB => {
return check crypto:decryptRsaEcb(cipherText, key);
}
_ => {
return error Error("Invalid/Missing key!");
}
}
return check crypto:decryptRsaEcb(cipherText, key);
} on fail var e {
return error Error(e.message());
}
Expand Down

0 comments on commit e5a872e

Please sign in to comment.