/** * Our constructor. * * @param uploadedKeystore the keystore content. * @deprecated */ @SuppressWarnings("unused") // by stapler @Deprecated public UploadedKeyStoreSource(String uploadedKeystore) { this.uploadedKeystoreBytes = StringUtils.isBlank(uploadedKeystore) ? null : SecretBytes.fromBytes(DescriptorImpl.toByteArray(Secret.fromString(uploadedKeystore))); }
/** * Checks the keystore content. * * @param value the keystore content. * @param password the password. * @return the {@link FormValidation} results. */ @SuppressWarnings("unused") // stapler form validation @Restricted(NoExternalUse.class) public FormValidation doCheckUploadedKeystore(@QueryParameter String value, @QueryParameter String password) { if (StringUtils.isBlank(value)) { return FormValidation.error(Messages.CertificateCredentialsImpl_NoCertificateUploaded()); } SecretBytes secretBytes = SecretBytes.fromString(value); byte[] keystoreBytes = secretBytes.getPlainData(); if (keystoreBytes == null || keystoreBytes.length == 0) { return FormValidation.error(Messages.CertificateCredentialsImpl_LoadKeystoreFailed()); } return validateCertificateKeystore("PKCS12", keystoreBytes, password); }
/** * Checks the keystore content. * * @param value the keystore content. * @param password the password. * @return the {@link FormValidation} results. */ @SuppressWarnings("unused") // stapler form validation @Restricted(NoExternalUse.class) public FormValidation doCheckUploadedKeystore(@QueryParameter String value, @QueryParameter String password) { if (StringUtils.isBlank(value)) { return FormValidation.error(Messages.CertificateCredentialsImpl_NoCertificateUploaded()); } SecretBytes secretBytes = SecretBytes.fromString(value); byte[] keystoreBytes = secretBytes.getPlainData(); if (keystoreBytes == null || keystoreBytes.length == 0) { return FormValidation.error(Messages.CertificateCredentialsImpl_LoadKeystoreFailed()); } return validateCertificateKeystore("PKCS12", keystoreBytes, password); }
/** * Migrate to the new field. * * @return the deserialized object. * @throws ObjectStreamException if something didn't work. * @since 2.1.5 */ private Object readResolve() throws ObjectStreamException { if (uploadedKeystore != null && uploadedKeystoreBytes == null) { return new UploadedKeyStoreSource(SecretBytes.fromBytes(DescriptorImpl.toByteArray(uploadedKeystore))); } return this; }
/** * Our constructor. * * @param uploadedKeystore the keystore content. * @deprecated */ @SuppressWarnings("unused") // by stapler @Deprecated public UploadedKeyStoreSource(String uploadedKeystore) { this.uploadedKeystoreBytes = StringUtils.isBlank(uploadedKeystore) ? null : SecretBytes.fromBytes(DescriptorImpl.toByteArray(Secret.fromString(uploadedKeystore))); }
/** * Migrate to the new field. * * @return the deserialized object. * @throws ObjectStreamException if something didn't work. * @since 2.1.5 */ private Object readResolve() throws ObjectStreamException { if (uploadedKeystore != null && uploadedKeystoreBytes == null) { return new UploadedKeyStoreSource(SecretBytes.fromBytes(DescriptorImpl.toByteArray(uploadedKeystore))); } return this; }