- # This is a hash of the parts of the key definition that we care about.
- # It is used as a unique identifier for this instance of apt::key. It gets
- # hashed to ensure that the resource name doesn't end up being pages and
- # pages (e.g. in the situation where key_content is specified).
- $digest = sha1("${key}/${key_content}/${key_source}/${key_server}/")
+ if $key_options != undef {
+ warning('$key_options is deprecated and will be removed in the next major release. Please use $options instead.')
+ $_options = $key_options
+ } else {
+ $_options = $options
+ }
+
+ validate_re($_id, ['\A(0x)?[0-9a-fA-F]{8}\Z', '\A(0x)?[0-9a-fA-F]{16}\Z', '\A(0x)?[0-9a-fA-F]{40}\Z'])
+ validate_re($ensure, ['\Aabsent|present\Z',])
+
+ if $_content {
+ validate_string($_content)
+ }
+
+ if $_source {
+ validate_re($_source, ['\Ahttps?:\/\/', '\Aftp:\/\/', '\A\/\w+'])
+ }
+
+ if $_server {
+ validate_re($_server,['\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$'])
+ }
+
+ if $_options {
+ validate_string($_options)
+ }