Skip to content

Commit bdf807a

Browse files
committed
ID-41: error message for invalid passphrase
1 parent fa2b740 commit bdf807a

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

CHANGELOG.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
= Changelog
22

3+
== Version 1.0.1
4+
[cols="1,2,<10a", options="header"]
5+
|===
6+
|ID|Type|Description
7+
|https://github.com/Axway-API-Management-Plus/apigw-maven-plugin/issues/40[#41]
8+
|Enhancement
9+
|Improve error message in case of wrong certificate passphrase.
10+
|===
11+
312
== Version 1.0.0
413
[cols="1,2,<10a", options="header"]
514
|===

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<groupId>com.axway.maven.plugins</groupId>
2121
<artifactId>apigw-maven-plugin</artifactId>
22-
<version>1.0.0</version>
22+
<version>1.0.1-SNAPSHOT</version>
2323
<packaging>maven-plugin</packaging>
2424

2525
<name>Axway API Gateway Maven Plugin</name>

src/main/resources/scripts/lib/fedconfig.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ def __get_key_from_p12(self, file, password=None):
149149
io = FileInputStream(file)
150150
pkcs12 = PKCS12(io)
151151
if password is not None:
152-
pkcs12.decrypt(String(password).toCharArray())
152+
try:
153+
pkcs12.decrypt(String(password).toCharArray())
154+
except:
155+
raise ValueError("Invalid passphrase for .p12 certificate!")
153156
return pkcs12.getKey()
154157

155158
def __get_cert_from_p12(self, file, password=None):

0 commit comments

Comments
 (0)